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

Add support for setting the cursor visibility in Terminal #4902

Merged
3 commits merged into from
Mar 13, 2020

Conversation

zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented Mar 13, 2020

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 the
TerminalCore. THIS DOES NOT ADD SUPPORT FOR DISABLING BLINKING IN THE
APP. Conpty doesn't emit the blinking on/off sequences quite yet, but
when it does, the Terminal will be ready.

References

PR Checklist

  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.
@zadjii-msft zadjii-msft added Area-VT Virtual Terminal sequence support Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Product-Terminal The new Windows Terminal. labels Mar 13, 2020
Copy link
Contributor

@DHowett-MSFT DHowett-MSFT left a 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
Copy link
Contributor

Choose a reason for hiding this comment

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

independently

Copy link
Member Author

Choose a reason for hiding this comment

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

asfdgkajenfklaerba classic me

Copy link
Member

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.

Copy link
Member

@miniksa miniksa left a 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.

@DHowett-MSFT
Copy link
Contributor

@msftbot merge this in 1 minute

@ghost ghost added the AutoMerge Marked for automatic merge by the bot when requirements are met label Mar 13, 2020
@ghost
Copy link

ghost commented Mar 13, 2020

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:

  • I won't merge this pull request until after the UTC date Fri, 13 Mar 2020 17:39:14 GMT, which is in 1 minute

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".

@ghost ghost merged commit 38058a7 into master Mar 13, 2020
@ghost ghost deleted the dev/migrie/b/3093-terminal-cursor-visibility branch March 13, 2020 17:39
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Area-VT Virtual Terminal sequence support AutoMerge Marked for automatic merge by the bot when requirements are met Product-Terminal The new Windows Terminal.
Projects
None yet
3 participants