-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add support for setting the cursor visibility in Terminal #4902
Conversation
Also corrects a misnomer in a `Terminal` method name. The cursor blinker should have been changing the cursor's `On` state, not the cursor's `Visible` state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems totally sane to me.
@@ -740,13 +740,16 @@ try | |||
CATCH_LOG() | |||
|
|||
// Method Description: | |||
// - Sets the visibility of the text cursor. | |||
// - Sets the cursor to be currently on. On/Off is tracked independantly of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
independently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asfdgkajenfklaerba classic me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Man, go read that spell check PR #4799 so we can make a computer catch these things for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is fine. I don't remember what all the flags on Cursor
do or are supposed to do anymore. One day we should probably reconcile all of them because I bet there's like 4-6 of them that are effectively duplicates with each other but just make the logic harder to follow.
Anyway... as long as this improves things for now, I'm fine with it. I don't see anything obviously wrong.
@msftbot merge this in 1 minute |
Hello @DHowett-MSFT! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
Adds support for setting the cursor visibility in Terminal. Visibility
is a property entirely independent from whether the cursor is "on" or
not. The cursor blinker should change the "IsOn" property. It was
actually changing the "Visible" property, which was incorrect. This PR
additionally corrects the naming of the method used by the cursor
blinker, and makes it do the right thing.
I added a pair of tests, one taken straight from conhost. In
copy-pasting that test, I took it a step further and implemented
^[[?12h
,^[[?12l
, which enables/disables cursor blinking, for theTerminalCore
. THIS DOES NOT ADD SUPPORT FOR DISABLING BLINKING IN THEAPP. Conpty doesn't emit the blinking on/off sequences quite yet, but
when it does, the Terminal will be ready.
References
PR Checklist