New 0.11 VT colors bug, background color isn't applied to " " (space) cells #7599

Closed
opened 2026-01-31 01:08:22 +00:00 by claunia · 7 comments
Owner

Originally created by @PhMajerus on GitHub (Apr 23, 2020).

Originally assigned to: @zadjii-msft on GitHub.

In Windows Terminal 0.11.1121.0, a new VT colors bug has been introduced.

When output contains VT escape sequences to set the background color, they are handled properly while the output is in the visible buffer viewport, but stops being applied to cells containing spaces when the output has to scroll to show the result.

The command used for repro is the following:
echo -e "\e[m\r\n\e[44;32m # \e[m#"
(4 spaces before first #, and 9 spaces after, GitHub HTML rendering swallows the extra spaces)

It reliably works fine until you reach the last line of the viewport, then the background color stops after the first # character:
WT 0 11 VT colros bug

Just make sure you repeat the command until you reach the bottom of the viewport.

Originally created by @PhMajerus on GitHub (Apr 23, 2020). Originally assigned to: @zadjii-msft on GitHub. In Windows Terminal 0.11.1121.0, a new VT colors bug has been introduced. When output contains VT escape sequences to set the background color, they are handled properly while the output is in the visible buffer viewport, but stops being applied to cells containing spaces when the output has to scroll to show the result. The command used for repro is the following: `echo -e "\e[m\r\n\e[44;32m # \e[m#"` (4 spaces before first #, and 9 spaces after, GitHub HTML rendering swallows the extra spaces) It reliably works fine until you reach the last line of the viewport, then the background color stops after the first # character: ![WT 0 11 VT colros bug](https://user-images.githubusercontent.com/25664275/80131257-3e9a9f80-859a-11ea-9f00-4094399239a3.png) Just make sure you repeat the command until you reach the bottom of the viewport.
claunia added the Resolution-Fix-CommittedArea-RenderingIssue-BugProduct-Conpty labels 2026-01-31 01:08:22 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Apr 23, 2020):

I bet I know exactly where this regressed

@zadjii-msft commented on GitHub (Apr 23, 2020): I bet I know exactly where this regressed
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 23, 2020):

Good, because I was worried it was my space elision 😉

@DHowett-MSFT commented on GitHub (Apr 23, 2020): Good, because I was worried it was my space elision :wink:
Author
Owner

@zadjii-msft commented on GitHub (Apr 23, 2020):

Oh I mean it's definitely in that mess. Maybe not your code directly, but that function's a mess. Fortunately there's a great repro here that can be trivially turned into a test, so I'll try and get this for 1.0.

@zadjii-msft commented on GitHub (Apr 23, 2020): Oh I mean it's definitely in that mess. Maybe not your code directly, but that function's a mess. Fortunately there's a great repro here that can be trivially turned into a test, so I'll try and get this for 1.0.
Author
Owner

@PhMajerus commented on GitHub (Apr 23, 2020):

@zadjii-msft It did take a while to find out how to reliably repro, I saw the problem seemed random and took a while to narrow it down until I found out it depends on the viewport append and scroll.

I'm still not sure why, but less spaces can prevent the problem, like if you had some optimization that looked ahead a few characters and tried to simplify spaces into a cursor move or something without considering the colors.

@PhMajerus commented on GitHub (Apr 23, 2020): @zadjii-msft It did take a while to find out how to reliably repro, I saw the problem seemed random and took a while to narrow it down until I found out it depends on the viewport append and scroll. I'm still not sure why, but less spaces can prevent the problem, like if you had some optimization that looked ahead a few characters and tried to simplify spaces into a cursor move or something without considering the colors.
Author
Owner

@zadjii-msft commented on GitHub (Apr 23, 2020):

if you had some optimization that looked ahead a few characters and tried to simplify spaces into a cursor move or something without considering the colors.

@PhMajerus do we ever

@zadjii-msft commented on GitHub (Apr 23, 2020): > if you had some optimization that looked ahead a few characters and tried to simplify spaces into a cursor move or something without considering the colors. @PhMajerus [do we ever](https://github.com/microsoft/terminal/blob/master/src/renderer/vt/paint.cpp#L442)
Author
Owner

@jdebp commented on GitHub (Apr 24, 2020):

Reprinting optimizations have to check a few things. Compare 79b1c0aab9/source/TUIOutputBase.cpp (L122) and ba7277cfb4/src/nvim/tui/tui.c (L496) .

@jdebp commented on GitHub (Apr 24, 2020): Reprinting optimizations have to check a few things. Compare https://github.com/jdebp/nosh/blob/79b1c0aab9834a09a59e15d47710f355c5c0417a/source/TUIOutputBase.cpp#L122 and https://github.com/jdebp/neovim/blob/ba7277cfb4e2556f246446d06b53f3427f28130f/src/nvim/tui/tui.c#L496 .
Author
Owner

@ghost commented on GitHub (May 5, 2020):

:tada:This issue was addressed in #5550, which has now been successfully released as Windows Terminal Release Candidate v0.11.1251.0 (1.0rc1).🎉

Handy links:

@ghost commented on GitHub (May 5, 2020): :tada:This issue was addressed in #5550, which has now been successfully released as `Windows Terminal Release Candidate v0.11.1251.0 (1.0rc1)`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v0.11.1251.0 (1.0rc1)) * [Store Download](https://www.microsoft.com/store/apps/9n0dx20hk701?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7599