Emacs cursor displayed incorrectly #3720

Closed
opened 2026-01-30 23:28:24 +00:00 by claunia · 6 comments
Owner

Originally created by @rlpeacock on GitHub (Sep 2, 2019).

Environment

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd]
 Win32NT             10.0.18922.0 Microsoft Windows NT 10.0.18922.0

Windows Terminal version (if applicable):
0.4.2382.0

Any other software?
Ubuntu 18.04.2
GNU Emacs 25.2.2

Steps to reproduce

echo "abc
def" > foo
emacs foo

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.

Originally created by @rlpeacock on GitHub (Sep 2, 2019). # Environment ```none Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd] Win32NT 10.0.18922.0 Microsoft Windows NT 10.0.18922.0 Windows Terminal version (if applicable): 0.4.2382.0 Any other software? Ubuntu 18.04.2 GNU Emacs 25.2.2 ``` # Steps to reproduce ``` echo "abc def" > foo emacs foo ``` 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.
Author
Owner

@DHowett-MSFT commented on GitHub (Sep 3, 2019):

version 1903, which I have

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?

@DHowett-MSFT commented on GitHub (Sep 3, 2019): > version 1903, which I have 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?
Author
Owner

@rlpeacock commented on GitHub (Sep 3, 2019):

No, this only happens within Terminal.

@rlpeacock commented on GitHub (Sep 3, 2019): No, this only happens within Terminal.
Author
Owner

@zadjii-msft commented on GitHub (Sep 3, 2019):

I can verify that this repros only in the terminal and not the 1903 conhost. So while this seems related to #283 & #1825, it's definitely a unique bug.

@zadjii-msft commented on GitHub (Sep 3, 2019): I can verify that this repros only in the terminal and not the 1903 conhost. So while this _seems_ related to #283 & #1825, it's definitely a unique bug.
Author
Owner

@egmontkob commented on GitHub (Oct 6, 2019):

Here's a tiny reproducer, created by totally stripping down emacs's script log:

printf 'abcd\r\e[?12h\e[C'; sleep 1; printf '\e[C'; sleep 100

Expected behavior: The cursor is between a and b for a second, and then moves forward to between b and c.

Actual behavior: The cursor does not move forward after one second.

Somehow that \e[?12h (start blinking cursor) triggers the misbehavior with a slight delay. It has to be placed towards the end before the sleep, e.g. after the carriage return.

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.

@egmontkob commented on GitHub (Oct 6, 2019): Here's a tiny reproducer, created by totally stripping down emacs's `script` log: printf 'abcd\r\e[?12h\e[C'; sleep 1; printf '\e[C'; sleep 100 Expected behavior: The cursor is between `a` and `b` for a second, and then moves forward to between `b` and `c`. Actual behavior: The cursor does not move forward after one second. Somehow that `\e[?12h` (start blinking cursor) triggers the misbehavior with a slight delay. It has to be placed towards the end before the sleep, e.g. after the carriage return. 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.
Author
Owner

@zadjii-msft commented on GitHub (Jan 22, 2020):

I have a sneaking suspicion that this is the same bug as #4102, but I'll leave both open to make sure.

@zadjii-msft commented on GitHub (Jan 22, 2020): I have a sneaking suspicion that this is the same bug as #4102, but I'll leave both open to make sure.
Author
Owner

@ghost commented on GitHub (Feb 13, 2020):

:tada:This issue was addressed in #4372, which has now been successfully released as Windows Terminal Preview v0.9.433.0.🎉

Handy links:

@ghost commented on GitHub (Feb 13, 2020): :tada:This issue was addressed in #4372, which has now been successfully released as `Windows Terminal Preview v0.9.433.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v0.9.433.0) * [Store Download](https://www.microsoft.com/store/apps/9n0dx20hk701?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3720