microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

  1. Open a WSL bash shell in Windows Terminal.
  2. 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:

  1. The cursor style is set to a non-blinking block (just to make the bug more obvious).
  2. The screen is cleared, and the cursor moved to the top right corner.
  3. The cursor is then moved one column back and a wide character () is written out.
  4. We wait for a second, to give the cursor a chance to render.
  5. The cursor is moved down a line.
  6. 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.

image

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).

🎉This issue was addressed in #14661, which has now been successfully released as Windows Terminal Preview v1.17.1023.🎉

Handy links: