-
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
Terminal: add support for showing/hiding the cursor (DECSET/DECRST 25, DECTCEM) #3093
Comments
Hey, we actually just got ConPTY support for rendering the cursor's hidden state (#2829). Right now, if conhost thinks the cursor is hidden it's not liable to leave it in the right place... I think we have another bug in here somewhere about the cursor being misplaced when deleting characters (and that's definitely something we shouldn't do :P) |
Tearing off the Triage tag: this is now the master Task for supporting cursor hiding in WT. 😄 (when the cursor is hidden by the application, conhost is a lot more lax in keeping its location in sync with the connected terminal) |
Note that the escape sequence used by the terminal/src/renderer/vt/XtermEngine.cpp Lines 106 to 112 in 6f667f4
The |
@j4james holy crap that's a good catch |
…lement cursor hiding, so this isn't really helpful by itself
note to self: I'm waiting on #4859 to merge because that PR's got most of the implementation of |
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 * I'd bet this conflicts with #2892 * This isn't a solution for #1379 * There shockingly isn't an issue for cursor blink state via conpty...? ## PR Checklist * [x] Closes #3093 * [x] Closes #3499 * [x] Closes #4644 * [x] I work here * [x] Tests added/passed * [n/a] Requires documentation to be updated
I finally got access to a computer using the Microsoft's Windows OS. That's the opportunity to find and mitigate all the problems encountered. This patch: 1. Introduce an option and a C++ definition to enable fallback for Microsoft's terminal emulators. This allows me to see/test the Microsoft output from Linux. This also allows Windows users to remove the fallback and target non Microsoft terminals if needed. 2. Microsoft's terminals do not provide a way to query if they support colors. As a fallback, assume true colors is supported. See issue: - microsoft/terminal#1040 This mitigates: - #135 3. Microsoft terminal do not handle properly hidding the cursor. Instead the character under the cursor is hidden, which is a big problem. As a result, we don't enable setting the cursor to the best position for [input method editors](https://en.wikipedia.org/wiki/Input_method), It will be displayed at the bottom right corner. See: - microsoft/terminal#1203 - microsoft/terminal#3093 4. The "cmd" on Windows do not properly report its dimension. Powershell works correctly. As a fallback, use a 80x80 size instead of 0x0. 5. There are several dom elements and component displayed incorrectly, because the font used is missing several unicode glyph. Use alternatives or less detailled one as a fallback.
I finally got access to a computer using the Microsoft's Windows OS. That's the opportunity to find and mitigate all the problems encountered. This patch: 1. Introduce an option and a C++ definition to enable fallback for Microsoft's terminal emulators. This allows me to see/test the Microsoft output from Linux. This also allows Windows users to remove the fallback and target non Microsoft terminals on Windows if needed. 2. Microsoft's terminal suffer from a race condition bug when reporting the cursor position: #136 The mitigation is not to ask for the cursor position in fullscreen mode where it isn't really needed and request it less often. This fixes: #136 3. Microsoft's terminal do not handle properly hidding the cursor. Instead the character under the cursor is hidden, which is a big problem. As a result, we don't enable setting the cursor to the best position for [input method editors](https://en.wikipedia.org/wiki/Input_method), It will be displayed at the bottom right corner. See: - microsoft/terminal#1203 - microsoft/terminal#3093 4. Microsoft's terminals do not provide a way to query if they support colors. As a fallback, assume true colors is supported. See issue: - microsoft/terminal#1040 This mitigates: - #135 5. The "cmd" on Windows do not properly report its dimension. Powershell works correctly. As a fallback, use a 80x80 size instead of 0x0. 6. There are several dom elements and component displayed incorrectly, because the font used is missing several unicode glyph. Use alternatives or less detailled one as a fallback.
I finally got access to a computer using the Microsoft's Windows OS. That's the opportunity to find and mitigate all the problems encountered. This patch: 1. Introduce an option and a C++ definition to enable fallback for Microsoft's terminal emulators. This allows me to see/test the Microsoft output from Linux. This also allows Windows users to remove the fallback and target non Microsoft terminals on Windows if needed. 2. Microsoft's terminal suffer from a race condition bug when reporting the cursor position: microsoft/terminal#7583. The mitigation is not to ask for the cursor position in fullscreen mode where it isn't really needed and request it less often. This fixes: #136 3. Microsoft's terminal do not handle properly hidding the cursor. Instead the character under the cursor is hidden, which is a big problem. As a result, we don't enable setting the cursor to the best position for [input method editors](https://en.wikipedia.org/wiki/Input_method), It will be displayed at the bottom right corner. See: - microsoft/terminal#1203 - microsoft/terminal#3093 4. Microsoft's terminals do not provide a way to query if they support colors. As a fallback, assume true colors is supported. See issue: - microsoft/terminal#1040 This mitigates: - #135 5. The "cmd" on Windows do not properly report its dimension. Powershell works correctly. As a fallback, use a 80x80 size instead of 0x0. 6. There are several dom elements and component displayed incorrectly, because the font used is missing several unicode glyph. Use alternatives or less detailled one as a fallback.
I finally got access to a computer using the Microsoft's Windows OS. That's the opportunity to find and mitigate all the problems encountered. This patch: 1. Introduce an option and a C++ definition to enable fallback for Microsoft's terminal emulators. This allows me to see/test the Microsoft output from Linux. This also allows Windows users to remove the fallback and target non Microsoft terminals on Windows if needed. 2. Microsoft's terminal suffer from a race condition bug when reporting the cursor position: microsoft/terminal#7583. The mitigation is not to ask for the cursor position in fullscreen mode where it isn't really needed and request it less often. This fixes: #136 3. Microsoft's terminal do not handle properly hidding the cursor. Instead the character under the cursor is hidden, which is a big problem. As a result, we don't enable setting the cursor to the best position for [input method editors](https://en.wikipedia.org/wiki/Input_method), It will be displayed at the bottom right corner. See: - microsoft/terminal#1203 - microsoft/terminal#3093 4. Microsoft's terminals do not provide a way to query if they support colors. As a fallback, assume true colors is supported. See issue: - microsoft/terminal#1040 This mitigates: - #135 5. The "cmd" on Windows do not properly report its dimension. Powershell works correctly. As a fallback, use a 80x80 size instead of 0x0. 6. There are several dom elements and component displayed incorrectly, because the font used is missing several unicode glyph. Use alternatives or less detailled one as a fallback.
Environment
Steps to reproduce
Expected behavior
The cursor should become invisible.
Actual behavior
The cursor remains visible and blinking. It is often misplaced on subsequent operations, though.
E.g. press the Up arrow, it brings back the previous printf command to the command line. Press the Left arrow, the cursor doesn't move. Press Backspace, the letter
l
is removed (that is, the logical cursor did indeed move to the left in the previous step), the cursor now blinks at the right edge.The text was updated successfully, but these errors were encountered: