Should the bold/bright attribute apply to SGR 38/48 indexed colors? #7445

Open
opened 2026-01-31 01:04:19 +00:00 by claunia · 0 comments
Owner

Originally created by @j4james on GitHub (Apr 17, 2020).

Environment

Windows build number: Version 10.0.18362.657
Windows Terminal version (if applicable): 0.10.781.0

Steps to reproduce

  1. Open a bash shell in conhost.
  2. Execute printf "\e[0;38;5;3mDARK \e[1mBRIGHT?\e[m\n"
  3. Open a bash shell in Window Terminal.
  4. Execute printf "\e[0;38;5;3mDARK \e[1mBRIGHT?\e[m\n"

Expected behavior

Both terminals should produce the same output showing the same colors.

Actual behavior

Conhost displays the "BRIGHT?" text in the same dark shade as the "DARK" text. Windows Terminal displays it brighter.

image

In some ways this could be considered a narrowing bug (issue #2661), because one reason for the difference is that conhost converts the indexed color into an RGB value before storing it, while the Windows Terminal doesn't. And the bold/bright attribute has no effect on RGB colors, but does affect indexed colors.

That said, I don't think the WT implementation is correct, so fixing the "narrowing" issue in conhost is just going to make both of them wrong. There is some room for interpretation here, but I've been looking at how other terminals handle this, and AFAICT most (including XTerm and VTE) will only apply the brightness attribute to the 8 basic colors, and not the 256 indexed colors from SGR 38/48.

So this is really a question as much as it is a bug report. Which behavior do we want to follow here? Because the answer to that is going to affect how we address issue #2661.

Originally created by @j4james on GitHub (Apr 17, 2020). # Environment Windows build number: Version 10.0.18362.657 Windows Terminal version (if applicable): 0.10.781.0 # Steps to reproduce 1. Open a bash shell in conhost. 2. Execute `printf "\e[0;38;5;3mDARK \e[1mBRIGHT?\e[m\n"` 3. Open a bash shell in Window Terminal. 4. Execute `printf "\e[0;38;5;3mDARK \e[1mBRIGHT?\e[m\n"` # Expected behavior Both terminals should produce the same output showing the same colors. # Actual behavior Conhost displays the "BRIGHT?" text in the same dark shade as the "DARK" text. Windows Terminal displays it brighter. ![image](https://user-images.githubusercontent.com/4181424/79517396-fa614980-8045-11ea-8485-2c6ade86a266.png) In some ways this could be considered a narrowing bug (issue #2661), because one reason for the difference is that conhost converts the indexed color into an RGB value before storing it, while the Windows Terminal doesn't. And the bold/bright attribute has no effect on RGB colors, but does affect indexed colors. That said, I don't think the WT implementation is correct, so fixing the "narrowing" issue in conhost is just going to make both of them wrong. There is some room for interpretation here, but I've been looking at how other terminals handle this, and AFAICT most (including XTerm and VTE) will only apply the brightness attribute to the 8 basic colors, and not the 256 indexed colors from SGR 38/48. So this is really a question as much as it is a bug report. Which behavior do we want to follow here? Because the answer to that is going to affect how we address issue #2661.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7445