Cursor droppings on wide chars in Windows Terminal
j4james opened this issue · comments
Windows Terminal version
1.16.2641.0
Windows build number
10.0.19044.2364
Other Software
No response
Steps to reproduce
- Open a WSL bash shell in Windows Terminal.
- Execute
printf "\e[2 q\e[2J\e[1;999H\e[D\u306F"; sleep 1; printf "\e[B\n"
This sequence is performing the following steps:
- The cursor style is set to a non-blinking block (just to make the bug more obvious).
- The screen is cleared, and the cursor moved to the top right corner.
- The cursor is then moved one column back and a wide character (
は
) is written out. - We wait for a second, to give the cursor a chance to render.
- The cursor is moved down a line.
- We output a newline (just so the shell prompt is back at the start of the line).
Expected Behavior
At the end of all that, there should only be one cursor visible on the screen.
Actual Behavior
In addition to the real cursor at the shell prompt, there is a second cursor left behind overlapping the は
character.
I realise this is probably not a typical scenario that you're likely to encounter, but it'll become more common once Windows Terminal implements delayed EOL wrap correctly (which is one of the thing I'm hoping to fix in PR #14640).
Note that this is not the same thing as #12739, which was the result of deferred cursor drawing. This is the result of a miscalculation in the cursor bounds checking, as explained in #13001 (comment).