GNOME Bugzilla – Bug 104968
color underline mode
Last modified: 2021-06-10 12:46:29 UTC
Xterm can make use of the X resources: colorBDMode and colorBD, and colorUL mode and colorUL. One can use these to assign colors to bold or underline text. This is very handy for reading man pages, viewing top, or other terminal content with bold and/or underline text.
Created attachment 14014 [details] A comparison of xterm and gnome-terminal
Bold text already has a different color (the default color location, but chosen from the second row of colors in gnome-terminal's palette rather than the first). Underlining, however, is a different matter. I haven't managed to get my local copy of Xterm to actually underline text, so once vte implemented underlining I didn't think it made sense to do both at the same time. Making this work requires adding a function to designate the underline color to the libvte interface, and whatever UI changes are necessary in gnome-terminal to make it customizable.
Thanks for looking into this. Setting gnome-terminal's second-row bold color works when I set my prompt to use bold, e.g. in tcsh: set prompt='%{^[[1;30m%}%m%{^[[0m%}> ' I think its the 1;30 that does it. But the bold text as displayed by top, nroff, etc. is still white. My palette scheme is based on Rxvt with the only change being color 9 is '#55aaff'.
This bears a bit of explanation. Traditionally you had an 8-color model. The default foreground color was 7 (gray), and the background was 0 (black). Bold colors were simply a "brighter" version of the existing colors, so the default bold color was bright gray = white. I'll call this a 16-color model. Along come terminal emulators, and you can suddenly choose a default foreground and background color pair that are different from the 8-color palette, and you can modify the contents of the bold palette. I call this an 18-color model. Applications don't know this, so to get a bright "1" (blue), they request color "1" and "bright", which is mapped to color "9" (brighter blue). The default colors are just a special case. For gray-on-black, having the default "bold" color be white makes sense, but if you switch to black-on-white, bold text being white is just stupid, so you add a "bold foreground" color, giving you a 19-color model. This is the model the VteTerminal widget currently uses (actually, that's not true, there are another 8 for "dim" colors), but that's why changing the 9th color gave you the expected results. I think we seriously need to overhaul gnome-terminal's color palette editor, in addition to adding the ability to set a custom color for underlined text (but then, you can set underlining on in combination with any foreground color, and now my head hurts).
... and of course, I forgot to make my point: gnome-terminal is using a color value for bold text in the foreground color which it currently doesn't let you edit.
Alright, many thanks for the explanation. I /think/ I understand. Here's a vote then for having the above features in gnome-terminal.
*** Bug 53436 has been marked as a duplicate of this bug. ***
*** Bug 353444 has been marked as a duplicate of this bug. ***
I'm now pushed the UI for selecting a separate bold color to g-t. Not for underline though. Can we close this now?
Thanks very much for working on this nearly 7 year old bug. (actually, https://bugzilla.gnome.org/show_bug.cgi?id=53436 is almost 9!) I'd love to have the bug remain open for the underline color too, but beggars can't be choosers. :)
That would need vte API first.
Thanks for making bold mode work. Is a vte API in the pipeline? How far away?
Nothing planned. But should be pretty easy. I'll add it next time I get to hacking vte.
ChPe, can you give me UI changes for separate underline color please? We may want to move the "Background color" widgets to be in the same row as "Text color" to make more room...
See bug 686043 too (the same issue for italic).
If implemented, the OSC 5;1 (or OSC 4;257) counterpart (and their resetting versions) should be added in addition to the API. See bug 722751.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vte/-/issues/741.