Escape sequence for bold, colored foreground doesn't work correctly

Bug #1806869 reported by GrimReaper11
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Terminator
New
Undecided
Unassigned

Bug Description

If I try to use a escape sequence to set text foreground to a 8-palette color and bold at the same time, I get not the regular color, but the bright variant:

# echo -e '\e[1;34mblue bold text\e[0m'
-> bright text

# echo -e '\e[1mbold text\e[0m'
-> works

# echo -e '\e[34mblue text\e[0m
-> works

echo -e '\e[1;38;5;4mblue bold text\e[0m'
-> also works

In xterm all of these work.

Terminator version: 1.91 (Arch Linux package 1.91-6)

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

VTE developer here. VTE is the terminal emulation widget used by Terminator.

What's your VTE version? Since you're on Arch, I assume it's the latest stable, 0.54.x.

A bold text also _appears_ to be brighter (on black background) due to antialiasing and such. Ideally the echoed text should contain a U+2588 █ or similar character, this helps clearly examine whether the color is also explicitly made brighter.

By default, xterm also brightens the color when the ambiguous "bold or bright" code (the number "1") is emitted. If that's not the behavior you experience, you probably run "xterm +pc" or specify the corresponding "boldColors: false" resource. (It could be that Arch Linux modifies the default, I don't know.) VTE's current behavior corresponds to xterm's default.

VTE 0.52 added the possibility of your preferred behavior, that is, to fully separate boldness from the colors. Alas, Terminator hasn't yet added the corresponding config option, see bug 1740311.

The next stable major release VTE 0.56 (GNOME 3.32) will make this new behavior the default. That is, no changes to Terminator necessary, the bold attribute won't touch the color, corresponding to "xterm +pc". This is good news for you, bad news for those who prefer the old (current) behavior and won't find an option to revert to that (unless Terminator catches up).

Revision history for this message
GrimReaper11 (o-mangold) wrote :

Correct, VTE ist 0.54.2. About the brightness, it is definitely the case that the bright colors are used (which can be seen by changing these).

I wasn't aware, though, that there is an ambiguity. According to https://www.xfree86.org/4.8.0/ctlseqs.html a "1" can only mean bold.

But yes, it seems Arch sets boldColors:on for xterm.

For background, the reason I am asking is that using sequences like 1;34m is default for many CLI tools (e.g. ls) and some cannot even be configured to explicitly use the non-bright versions (info, git). So I consider the change really to be good news.

Thanks for your answer.

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

> According to [...] a "1" can only mean bold.

The document you linked is about xterm's behavior in particular (and an ancient version thereof). You might want to check ECMA-48 (a.k.a. ISO 6429) § 8.3.117 instead, as well as the practice of most terminal emulators making them bright.

> But yes, it seems Arch sets boldColors:on for xterm.

Wait, isn't it the "off" setting correspond to your experience and your preferred behavior?

Revision history for this message
GrimReaper11 (o-mangold) wrote :

Ah, I see, its the complete ANSI spec. Yes, way more complex. Always learning something new...

About boldColors, not sure, it's on in the Resources file, but might be set to off somewhere else. Nevermind, I think the issue is clear enough, now :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.