Use Bold To Mean Bold Text Where It Is Currently Ignored #22624

Open
opened 2026-01-31 08:18:50 +00:00 by claunia · 0 comments
Owner

Originally created by @CannibalVox on GitHub (Dec 4, 2024).

Description of the new feature

Currently, the presence of the bold tag (\e[1m) is used to indicate that one of the original 8 basic colors (30-37) ought to be "bold". The meaning of bold is configurable, but the default is that these colors are promoted to their bright variants. If the color is not 30-37, if it is 256-color, if it is a true-color, the bold tag is ignored, unless the terminal has been configured to use bold text for the bold tag.

This decision was made because this is the original behavior (and is still broadly in use) of the bold tag for the 8 basic colors.

However, under this scheme, using the bold tag in conjunction with a 256-color (for instance \e[0;1;38;5;1) will cause the bold tag to be ignored entirely unless the terminal has been specifically configured otherwise. It is far more common when these tags are used together to use bold text, even in cases where a terminal interprets bold as bright. There's also no downside to interpreting it this way, since there is no expectation that the bold tag will change the color of text being styled with 256-colors or true-colors.

The one downside is what to do when text transitions away from text that was using bold-is-bright into a 256-color. I would argue that there is no real problem with either maintaining the bold styling even in this case, or in not doing so. I assume the former is easier.

Proposed technical implementation details

When the bold tag is active and the text is colored using 256 or truecolor, display bold text.

For instance, the following uses the terminal settings (which by default would make the text bright red):
\e[0;1;31mI am bright red!\e[0m

But the following would display dark red in bold text:
\e[0;1;38;5;1mI am bold dark red!\e[0m

And the following would display bright red in bold text:
\e[0;1;38;5;9mI am bold bright red!\e[0m

The following would display the first portion in bright red and the second portion in bold dark red:
\e[0;1;31mI am bright red! \e[38;5;1mI am bold dark red!\e[0m

Originally created by @CannibalVox on GitHub (Dec 4, 2024). ### Description of the new feature Currently, the presence of the bold tag (\e[1m) is used to indicate that one of the original 8 basic colors (30-37) ought to be "bold". The meaning of bold is configurable, but the default is that these colors are promoted to their bright variants. If the color is not 30-37, if it is 256-color, if it is a true-color, the bold tag is ignored, unless the terminal has been configured to use bold text for the bold tag. This decision was made because this is the original behavior (and is still broadly in use) of the bold tag for the 8 basic colors. However, under this scheme, using the bold tag in conjunction with a 256-color (for instance \e[0;1;38;5;1) will cause the bold tag to be ignored entirely unless the terminal has been specifically configured otherwise. It is far more common when these tags are used together to use bold text, even in cases where a terminal interprets bold as bright. There's also no downside to interpreting it this way, since there is no expectation that the bold tag will change the color of text being styled with 256-colors or true-colors. The one downside is what to do when text transitions away from text that was using bold-is-bright into a 256-color. I would argue that there is no real problem with either maintaining the bold styling even in this case, or in not doing so. I assume the former is easier. ### Proposed technical implementation details When the bold tag is active and the text is colored using 256 or truecolor, display bold text. For instance, the following uses the terminal settings (which by default would make the text bright red): \e[0;1;31mI am bright red!\e[0m But the following would display dark red in bold text: \e[0;1;38;5;1mI am bold dark red!\e[0m And the following would display bright red in bold text: \e[0;1;38;5;9mI am bold bright red!\e[0m The following would display the first portion in bright red and the second portion in bold dark red: \e[0;1;31mI am bright red! \e[38;5;1mI am bold dark red!\e[0m
claunia added the Issue-FeatureArea-RenderingArea-VTNeeds-Tag-FixProduct-Terminal labels 2026-01-31 08:18:51 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22624