Conpty cursor mispositioned when using double width lines #15014
Labels
Area-VT
Virtual Terminal sequence support
Help Wanted
We encourage anyone to jump in on these.
In-PR
This issue has a related PR
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Needs-Tag-Fix
Doesn't match tag requirements
Product-Conpty
For console issues specifically related to conpty
Milestone
Windows Terminal version
1.17.1023
Windows build number
10.0.19044.2364
Other Software
No response
Steps to reproduce
clear
to make sure he screen is cleared.printf "\e#6\e[999Cv\e#5\n\e#6\e[999C*\e[B^\n"
Expected Behavior
The
v
and^
characters should be in the same column, looking something like this:Actual Behavior
The
^
character is one column to the left ofv
.I'm almost sure this used to work in the past, so I suspect this might be fallout from one of the delayed EOL wrap fixes (possibly PR #14640 or PR #14936).
What's happening is the
*
is written at the end of a double-width line, so the cursor sets the delayed wrap flag, but doesn't move forward. However, conpty doesn't recognise that state, so it thinks the cursor is one column to the right of where it really is. Then when it needs to move down a row to output the^
, it uses a backspace to adjust the column offset, but that adjustment wasn't needed, so the^
ends up in the wrong column.I think the easiest fix for this would be to disable the conpty cursor optimisations whenever we've got double-width lines renditions on the page. That just requires adding the
_usingLineRenditions
flag to the condition here:terminal/src/renderer/vt/XtermEngine.cpp
Lines 280 to 293 in b9248fa
The text was updated successfully, but these errors were encountered: