Colored underlines in set_color and fish_color_*

Add a new underline-color option to set_color (instead of adding an optional
color argument to --underline); this allows to set the underline color
independently of underline style (line, curly, etc.). I don't think this
flexibility is very important but this approach is probably the least hacky.

Note that there are two variants:
1. \e[58:5:1m
2. \e[58;5;1m

Variant 1 breaks:
breakage from colon-variant for colored underlines
- cool-retro-term makes text blink
- GNU screen (goes into bold mode)
- terminology (goes into bold mode)

Variant 2 would break:
- mintty (Cygwin terminal) -- it enables bold font instead.
- Windows Terminal (where it paints the foreground yellow)
- JetBrains terminals echo the colons instead of consuming them
- putty
- GNU screen (goes into bold mode)
- st
- urxvt
- xterm
- etc.

So choose variant 1.

Closes #11388
Closes #7619
This commit is contained in:
Johannes Altmanninger
2025-04-14 15:36:50 +02:00
parent cc9849c279
commit ce631fd2fb
12 changed files with 196 additions and 83 deletions

View File

@@ -37,6 +37,9 @@ The following options are available:
**-b** or **--background** *COLOR*
Sets the background color.
**--underline-color** *COLOR*
Set the underline color.
**-c** or **--print-colors**
Prints the given colors or a colored list of the 16 named colors.