Skip to content

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

@j4james

Description

@j4james

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Area-VTVirtual Terminal sequence supportIssue-BugIt either shouldn't be doing this or needs an investigation.Needs-Tag-FixDoesn't match tag requirementsProduct-TerminalThe new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions