-
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
Emacs cursor displayed incorrectly #2642
Comments
That means it's been fixed for the in-box console host. Does this reproduce if you don't use Windows Terminal, but instead just launch WSL directly? |
No, this only happens within Terminal. |
Here's a tiny reproducer, created by totally stripping down emacs's
Expected behavior: The cursor is between Actual behavior: The cursor does not move forward after one second. Somehow that DEC private mode 12 doesn't seem to be supported by WT, toggling it high/low doesn't affect cursor blinking. It's also unclear to me how it should relate to DECSCUSR. Emacs loves toggling DEC private modes 12 as well as 25 (cursor visibility) back and forth, often combined into a single escape sequence. This bug is probably closely related to, if not the same as #3093. |
I have a sneaking suspicion that this is the same bug as #4102, but I'll leave both open to make sure. |
## Summary of the Pull Request This is a pair of related fixes to conpty. For both of these bugs, the root cause was that the cursor was getting set to Off in conpty. Without the `CursorBlinkerTimer`, the cursor would remain off, and frames that only had cursor movements would not update the cursor position in the terminal. ## References ## PR Checklist * [x] Closes #4102 * [x] Closes #2642 * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments Recall that there's a bunch of cursor state that's hard to parse without looking up: * `Visibility` This controls whether the cursor is visible _at all_, regardless if it's been blinked on or off * `Blinking` controls whether the blinker timer should do something, or leave the cursor alone. * `IsOn`: When the cursor is blinking, this alternates between true and false. The trick here is that we only `TriggerCursorMoved` when the cursor is `On`, and there are some scenarios where the cursor is manually set to off. Fundamentally, these two bugs are similar cases, but they are triggered by different things: * #2642 was caused by `DoSrvPrivateAllowCursorBlinking(false)` (`^[[?12l`) also manually turning the cursor off. * #4102 was caused by the client calling `SetConsoleScreenBuffer` to change the active buffer. `win-curses` actually uses that API instead of the alt buffer.
🎉This issue was addressed in #4372, which has now been successfully released as Handy links: |
Environment
Steps to reproduce
Press down arrow, then up arrow. Cursor is now on 'a' on first line.
Try C-e (control+e). Cursor should move to end of line but does not appear to move. Hit right arrow. Cursor moves to 'd' on 2nd line.
Press up arrow again. Press right arrow four times. Cursor remains on first character until 4th press at which point it jumps to 'd' on 2nd line again.
Clearly the cursor is moving but the display is not reflecting that.
Note that as with #283 setting terminal to rxvt or using tmux fixes the issue, however, that bug was marked as fixed in version 1903, which I have.
Expected behavior
Cursor should move in response to keystrokes.
Actual behavior
Cursor appears not to move until movement takes it to a new line.
The text was updated successfully, but these errors were encountered: