Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix console errors #457

Merged
merged 2 commits into from
Dec 11, 2020
Merged

Conversation

tlmii
Copy link
Member

@tlmii tlmii commented Dec 8, 2020

Fixes #443.

See #443 (comment) for details on the specific problems in HttpRepl and microsoft/terminal#8312 for some background on why the issues show up differently (or not at all) in different terminals.

Essentially, HttpRepl tied the caret position on the input buffer to the caret position of the console window in a way that causes problems in virtual terminals (e.g. Windows Terminal). Not all terminals were impacted the same way, though all variants other than vanilla cmd.exe had problems.

To fix this, we "disconnect" the cursor position in the console window from the cursor position in the input buffer, but still move them together when appropriate. The concept of the CaretPosition is moved from the ConsoleManager to the InputManager (since it tracks with the input buffer more directly than it does with the console cursor) and the CaretUpdateScope concept is removed completely.

One thing we are lacking, that this PR does not address, is the ability to actually drive the console output of various consoles to ensure the input buffer caret and the console caret track properly when they're supposed to.

Copy link

@bzhu94 bzhu94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link

@bzhu94 bzhu94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link

@bzhu94 bzhu94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@tlmii tlmii merged commit 52fbdca into dotnet:release/5.0.1 Dec 11, 2020
@tlmii tlmii deleted the dev/fix-console-errors-5.0.1 branch December 11, 2020 19:20
tlmii added a commit to tlmii/HttpRepl that referenced this pull request Jan 4, 2021
* Fix console errors

* Tweaking test code
tlmii added a commit that referenced this pull request Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants