Unexpected behavior of ANSI 256 colors 0-7 and SGR 1? #21315

Closed
opened 2026-01-31 07:39:58 +00:00 by claunia · 5 comments
Owner

Originally created by @magus424 on GitHub (Feb 26, 2024).

Windows Terminal version

1.18.10301.0

Windows build number

10.0.22621.0

Other Software

No response

Steps to reproduce

Set "Intense text style" in the profile Appearance settings to "Bright colors"

Run echo -e '\e[0;34m 0;34m blue \e[0m\n\e[1;34m 1;34m high intensity blue \e[0m\n\e[38;5;4m 38;5;4m blue \e[0m\n\e[38;5;4m\e[1m 38;5;4m + 1m - high intensity blue? \e[0m\n\e[38;5;12m 38;5;12m bright blue \e[0m'

Expected Behavior

image
(image taken while in tmux 3.2a which somehow adjusts the behavior to match what I would expect, even if I change the "Intense text style" from bright to bold)

Actual Behavior

image
SGR1 is ignored, despite the color being in the basic 0-7 system range which I would expect to bump up to 8-15 given the "Bright colors" setting, similar to how 1;34m matches 94m with the bright setting.

On the other hand, if you flip the setting to "Bold font", the interaction works as I would expect:
image

Originally created by @magus424 on GitHub (Feb 26, 2024). ### Windows Terminal version 1.18.10301.0 ### Windows build number 10.0.22621.0 ### Other Software _No response_ ### Steps to reproduce Set "Intense text style" in the profile Appearance settings to "Bright colors" Run `echo -e '\e[0;34m 0;34m blue \e[0m\n\e[1;34m 1;34m high intensity blue \e[0m\n\e[38;5;4m 38;5;4m blue \e[0m\n\e[38;5;4m\e[1m 38;5;4m + 1m - high intensity blue? \e[0m\n\e[38;5;12m 38;5;12m bright blue \e[0m'` ### Expected Behavior ![image](https://github.com/microsoft/terminal/assets/384053/20fa8649-bfba-43a9-9f8e-b0b35534f7a2) (image taken while in tmux 3.2a which somehow adjusts the behavior to match what I would expect, even if I change the "Intense text style" from bright to bold) ### Actual Behavior ![image](https://github.com/microsoft/terminal/assets/384053/39e192e2-f3f1-4b97-9e94-c1d5fe59c6f7) SGR1 is ignored, despite the color being in the basic 0-7 system range which I would expect to bump up to 8-15 given the "Bright colors" setting, similar to how `1;34m` matches `94m` with the bright setting. On the other hand, if you flip the setting to "Bold font", the interaction works as I would expect: ![image](https://github.com/microsoft/terminal/assets/384053/44fe4250-80a0-4228-bc66-568b37ae4d77)
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 07:39:59 +00:00
Author
Owner

@DHowett commented on GitHub (Feb 26, 2024):

Oh, I totally remember this one!

When we refined our support for the 256-color Xterm palette, we chose not to intensify those colors. Xterm treats them as being distinct, and so we follow their lead.

image

@DHowett commented on GitHub (Feb 26, 2024): Oh, I totally remember this one! When we refined our support for the 256-color Xterm palette, we chose _not_ to intensify those colors. Xterm treats them as being distinct, and so we follow their lead. ![image](https://github.com/microsoft/terminal/assets/189190/0310646a-f471-4feb-98ef-8c166cc626ea)
Author
Owner

@DHowett commented on GitHub (Feb 26, 2024):

Thanks for the report! This was an intentional decision, based on how other terminal emulators work. I went and dug up some of our older discussions to give you more context. 😄

Here's the short version:

I'll tentatively close this one out as a /duplicate of #5384 😄

Stealing some notes from https://github.com/microsoft/terminal/issues/11507#issuecomment-943481690

@DHowett commented on GitHub (Feb 26, 2024): > Thanks for the report! This was an intentional decision, based on how other terminal emulators work. I went and dug up some of our older discussions to give you more context. 😄 > > Here's the short version: > > * xterm 331 chose to brighten 256-indexed colors 0-7 > * xterm 348 silently reverted this behavior > * An issue was filed on libvte (engine powering gnome-terminal) documenting the above: [gitlab.gnome.org/GNOME/vte/-/issues/149](https://gitlab.gnome.org/GNOME/vte/-/issues/149) > * We have an issue discussing this: [Should the bold/bright attribute apply to SGR 38/48 indexed colors? #5384](https://github.com/microsoft/terminal/issues/5384) > > I'll tentatively close this one out as a /duplicate of #5384 😄 Stealing some notes from https://github.com/microsoft/terminal/issues/11507#issuecomment-943481690
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Feb 26, 2024):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service[bot] commented on GitHub (Feb 26, 2024): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! <!-- Policy app identification https://img.shields.io/static/v1?label=PullRequestIssueManagement. -->
Author
Owner

@magus424 commented on GitHub (Feb 26, 2024):

@DHowett fair enough - I missed those older issues in my searching - appreciate the links :)

@magus424 commented on GitHub (Feb 26, 2024): @DHowett fair enough - I missed those older issues in my searching - appreciate the links :)
Author
Owner

@DHowett commented on GitHub (Feb 26, 2024):

No problem! It's good for us to get refreshed on these things too. I feel like we should have documentation for which "stances" we have taken on potentially-controversial issues in terminal emulation.

@DHowett commented on GitHub (Feb 26, 2024): No problem! It's good for us to get refreshed on these things too. I feel like we should have documentation for which "stances" we have taken on potentially-controversial issues in terminal emulation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21315