edit icon indicating copy to clipboard operation
edit copied to clipboard

Caret (text cursor) animation does not work as intended within conhost (Windows 10)

Open Mason199004 opened this issue 7 months ago • 4 comments

The caret blink animation is supposed to reset whenever the carets position changes to make following it easier. However, in conhost the blink animation continues, erratically, during caret movement, which makes it extremely difficult or impossible to follow the caret.

Mason199004 avatar May 23 '25 04:05 Mason199004

I believe that this "animation reset" is a feature of the host terminal, not of the program using the terminal. I have just used edit on Windows Terminal, and it had the behaviour you mentioned. However, when I used it on CMD, it did lack this "animation reset". This also happened when I used Vim and WATCOM Vi. Hence, it would not be a bug. This is further evidenced by the fact that cmd.exe lets you chose the style of your cursor.

However, although the Win32 API does not seem to support control of the blinking, the Console Virtual Terminal Sequences do. It supports to toggle the blinking through printing <ESC>[?12h and <ESC>[?12l. So, the project edit could support the behaviour you mentioned, consistently between hosts.

However, I would still consider this not a bug.

schilive avatar May 23 '25 05:05 schilive

I believe that this "animation reset" is a feature of the host terminal, not of the program using the terminal. I have just used edit on Windows Terminal, and it had the behaviour you mentioned. However, when I used it on CMD, it did lack this "animation reset". This also happened when I used Vim and WATCOM Vi. Hence, it would not be a bug. This is further evidenced by the fact that cmd.exe lets you chose the style of your cursor.

However, although the Win32 API does not seem to support control of the blinking, the Console Virtual Terminal Sequences do. It supports to toggle the blinking through printing <ESC>[?12h and <ESC>[?12l. So, the project edit could support the behaviour you mentioned, consistently between hosts.

However, I would still consider this not a bug.

the animation reset occurs in vim under conhost as well so its not a conhost issue. i've tried it with a few other things in conhost and the blinking behavior is the same in everything except edit. my guess is the issue is caused by edit using a custom caret instead of conhost's default underbar caret

Mason199004 avatar May 23 '25 06:05 Mason199004

That would make sense. An idea: you could make a short video of what happens and of what should happen. I think it would make your point very clear. It could be a GIF, I think.

schilive avatar May 23 '25 07:05 schilive

Coincidentally I'm the primary maintainer of conhost, so I can tell you with full confidence that this is a flaw in conhost. But I'll see if we can work around it by disabling the cursor while moving it during the screen refresh/rendering.

lhecker avatar May 23 '25 12:05 lhecker