-
Notifications
You must be signed in to change notification settings - Fork 9.2k
ITU/ODA colors with a zero color space don't work #19547
Copy link
Copy link
Labels
Area-VTVirtual Terminal sequence supportVirtual Terminal sequence supportHelp WantedWe encourage anyone to jump in on these.We encourage anyone to jump in on these.Issue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Needs-Tag-FixDoesn't match tag requirementsDoesn't match tag requirementsPriority-3A description (P3)A description (P3)Product-ConhostFor issues in the Console codebaseFor issues in the Console codebaseProduct-TerminalThe new Windows Terminal.The new Windows Terminal.
Milestone
Metadata
Metadata
Assignees
Labels
Area-VTVirtual Terminal sequence supportVirtual Terminal sequence supportHelp WantedWe encourage anyone to jump in on these.We encourage anyone to jump in on these.Issue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Needs-Tag-FixDoesn't match tag requirementsDoesn't match tag requirementsPriority-3A description (P3)A description (P3)Product-ConhostFor issues in the Console codebaseFor issues in the Console codebaseProduct-TerminalThe new Windows Terminal.The new Windows Terminal.
Windows Terminal version
1.24.2812.0
Windows build number
10.0.19045.5371
Other Software
No response
Steps to reproduce
Open a WSL shell and execute the following statements:
These are ITU T.416 RGB color sequences that set the foreground to bright red. The first case is using a default color space ID, and the second case has the color space ID set to zero, which should be the same thing.
Expected Behavior
In both cases I'd expect the text to be rendered with a red foreground color.
Actual Behavior
Only the first case is red - the second case is rendered with the default attributes.
Looking at the code, it seems this was somewhat by design. We're trying to detect cases where the sequence is incorrectly formatted, with the red component in the position of the color space ID. And the assumption is that it's better to ignore those sequences than produce a completely wrong color.
terminal/src/terminal/adapter/adaptDispatchGraphics.cpp
Lines 128 to 131 in 4701844
But if we're going to take that approach, I think the test probably needs to be stricter, because this is clearly not an incorrectly formatted colour - it has all the required components. And most other terminals that support ITU colors do render this case correctly (although we're not the only one that fails).
So maybe we should only be rejecting sequences that have a non-default color space, but also have a missing blue component?