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

@@ -90,12 +90,15 @@ Syntax highlighting variables
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The colors used by fish for syntax highlighting can be configured by changing the values of various variables. The value of these variables can be one of the colors accepted by the :doc:`set_color <cmds/set_color>` command.
The modifier switches accepted by ``set_color`` like
Options accepted by ``set_color`` like
``--background=``,
``--bold``,
``--dim``,
``--italics``,
``--reverse`` and
``--underline`` are also accepted.
``--reverse``,
``--underline`` and
``--underline-color=``
are also accepted.
Example: to make errors highlighted and red, use::