Bug#910078: the bold capability does not work after sgr0

Egmont Koblinger egmont at gmail.com
Tue Oct 2 21:49:00 BST 2018


Hi,

At the end of your prompt you emit \e[37m, that is, change to the 7th
palette color (typically light gray), rather than the default color of
your emulator. That is, the status at the beginning of executing your
command, the status used for the letter "A" is not the default status,
not the one which you achieve using tput sgr0 or \e[m or \e[0m. This
explains why "B" and "D" don't have the same attributes.

Go to GNOME Terminal's preferences, switch to the Colors tab under
your profile. You'll find the "Default color" (potentially overridden
by "Use colors from system theme"), this is what sgr0 a.k.a. \e[m
switches to. You'll also see the 2x8 "Color palette" entries, the
upper right of them is selected by \e[37m. Even if these two have the
very same RGB value, they might behave differently when combined with
the ambiguous "bold/bright" flag.

VTE 0.54 changed a couple of things in how it handles colors. The
changes were intentional, made in the direction of separating the bold
attribute from the colors.

The bold counterpart of the default color used to be an automatically
generated brighter variant of that color. If your default text color
is a light shade of gray, the automatically generated brigher variant
was most likely #FFFFFF. It's no longer the case, the combination of
the bold flag with the default text color still uses the exact same
text color, just with bold font. If you preferred the old behavior of
making the text brighter, you should set whatever color you'd prefer
here as the "Bold color".

For the 7th palette color, the bold variant used to switch to the 15th
palette color (the one shown underneath). Beginning with 0.54 this
behavior is no longer mandatory, can be switched off by disabling
"Show bold text in bright colors". (By the way, starting with 0.56
it'll be disabled by default for new users. The same checkbox will
remain there for users to re-enable switching to the brighter
counterpart.)

I hope this clarifies what's going on.

cheers,
egmont



More information about the pkg-gnome-maintainers mailing list