ANSI/VT bleeds through empty spaces on right when resizing console with wrap on resize enabled #75
Labels
Product-Conhost
For issues in the Console codebase
Resolution-Duplicate
There's another issue on the tracker that's pretty much the same thing.
Work-Item
It's being tracked by an actual work item internally. (to be removed soon)
From @PhMajerus on October 26, 2017 15:29
Concerns Redstone 3 RTW / Windows 10 ver. 1709, tested on build 16299.19. Affects all WSL distros and more broadly, all Win32 CUI apps using VT.
VT text properties let us control the colors and other text attributes such as underline in-band.
When "Wrap on resize" is enabled, conhost automatically modifies the text buffer when the window is resized to reflow text, and, if necessary, padding lines with spaces until the '\n' is encountered.
The problem is when it pads with spaces, it applies the attributes of the last non-whitespace character of the line to them, instead of the attributes in effect after the last character.
This has the effect of extending colors, underline,... to the end of the line.
It should instead apply the attributes as per the state of the VT parser at that insertion point, which is often different as many scripts output "closing" VT sequences just before a \n or a whitespace.
This screenshot shows the issue using bash, both sets of lines should look exactly the same, but the window has been resized between the two commands, making the attributes of the "Line1" bleed through to the end of the line in the first set.
Note the "\e[m" explicitly stops the dark red background and underline, so applying it to padding spaces isn't up to interpretation, these attributes stop after the character '1'.
Even adding a whitespace after "\e[m" exhibits the same issue, so conhost seems to be grabbing the text attributes of the last non-whitepace character of the line when processing the wrap-on-resize.
Copied from original issue: microsoft/WSL#2607
The text was updated successfully, but these errors were encountered: