Fix ViModeIndicator = Cursor for Windows Terminal#3374
Merged
daxian-dbw merged 2 commits intoPowerShell:masterfrom Jul 8, 2022
Merged
Fix ViModeIndicator = Cursor for Windows Terminal#3374daxian-dbw merged 2 commits intoPowerShell:masterfrom
ViModeIndicator = Cursor for Windows Terminal#3374daxian-dbw merged 2 commits intoPowerShell:masterfrom
Conversation
andyleejordan
approved these changes
Jul 8, 2022
Comment on lines
+50
to
+54
| // See the cursor ANSI codes at https://www.real-world-systems.com/docs/ANSIcode.html, searching for 'blinking block'. | ||
| // We write out the ANSI escape sequence even if we are on Windows, where the 'Console.CursorSize' API is supported by .NET. | ||
| // This is because this API works fine in console host, but not in Windows Terminal. The escape sequence will configure the | ||
| // cursor as expected in Windows Terminal, while in console host, the escape sequence works after it's written out, but then | ||
| // will be overwritten by 'CursorSize' when the user continues typing. |
Member
There was a problem hiding this comment.
Does this mean there's a bit of a race condition where it can look unexpectedly different before the user continues typing?
Member
Author
There was a problem hiding this comment.
There could be. The blinking underscore shape from Ansi code is thinner that "Console.CursorSize = 25" in console host, but not different too much. In Windows Terminal, there is no race condition, since we can change the cursor shape only through the Ansi sequences.
Member
Author
|
Thanks @andschwa for the review! |
|
🎉 |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Fix #3334
Fix #1233
Fix
ViModeIndicator = Cursorfor Windows Terminal by writing out escape sequences that configure cursor shape.PR Checklist
Microsoft Reviewers: Open in CodeFlow