-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing bug in 24bit VT colors #1681
Comments
I found out other control sequences, such as underline or reverse, also reset the RGB colors. |
@PhMajerus thanks for the very well detailed bug report! I think you're right that this is the wrong behavior. I don't think that this fix will make it in time for Creators Update, but I've added MSFT:11027962 to track it for the next release. |
Thanks for looking into this, it didn't get fixed for RS2, but I really hope it can get fixed in a CU before RS3. |
@zadjii-msft I have two questions if you don't mind. When you say
Thanks |
@gpakosz Yes, when I prefix arbitrary numbers with "MSFT:" those are our internal work tracking numbers. By "next release" I mean whatever comes after Creator's Update. We VERY rarely service conhost.exe, if ever. And just because it's being tracked for the next release doesn't necessarily mean it'll make the cut - we currently have a ton of work that's booked, so this will have to get triaged just like everything else, though it seems like a simple fix so it shouldn't be too hard to get in. |
@PhMajerus Got this one pinned down. It's in code review as we speak :) |
Should be out to Insiders sometime in the next few months. |
@zadjii-msft That's great news, thanks. I'll test all the VT things again from Win32 CUI when it arrives in my ring. |
Thanks @zadjii-msft |
VT escape sequences can define both background and foreground, or reset them to default colors.
When using 39 or 49 to reset the foreground or background respectively, these two commands reset both at the same time instead.
Setting foreground then resetting background shouldn't reset the foreground as well, and setting background then resetting foreground shouldn't reset the background.
In RS2, setting one using RGB, then reset the other one ends up resetting both. This worked fine (although limited to 16colors mapping) in RS1.
This has been introduced with the support for real 24bit colors (without mapping) and is still present in 15031.
Repro steps:
The following command should display "TestTest" in light blue :
echo -e "\E[38;2;64;128;255mTest\E[49mTest\E[m"
Instead, the second "Test" is shown in default color, but 49 shouldn't reset the color set by 38;2;R;G;B, it should only reset the background color.
Same problem happens to background color if foreground color is reset after :
echo -e "\E[48;2;64;128;255mTest\E[39mTest\E[m"
Again, 39 shouldn't reset the background set by 48:2;R;G;B, it should only reset the foreground color.
This issue breaks any software that controls both foreground and background and uses 39 and 49 to reset either color. It doesn't only break bash in WSL, it also breaks the same VT in PowerShell or any console app as the problem is in the conhost VT parser.
The text was updated successfully, but these errors were encountered: