Files
fish-shell/share/tools/web_config
Johannes Altmanninger c8f2471357 Stop --background=somecolor from implicitly setting the bold modifier
As reported in https://github.com/fish-shell/fish-shell/issues/11325, we have logic that
implicitly activates bold mode.

Even worse: the test case from https://github.com/fish-shell/fish-shell/issues/11426 shows that
we're not even consistent about that.

To reproduce, use

    set -g fish_pager_color_background --background=fff
    set -g fish_pager_color_prefix --underline --bold 000
    set -g fish_pager_color_completion
    set -g fish_pager_color_description
    complete : -s a -l all -d asdf

and type ": -" <TAB>

The second prefix is underlined but not bold,
because the implicit bold mode has a subtle bug.

Now if we were to fix this, using

    diff --git a/src/terminal.rs b/src/terminal.rs
    index b86a7d85fe..7791d34936 100644
    --- a/src/terminal.rs
    +++ b/src/terminal.rs
    @@ -589,7 +589,7 @@
             // Lastly, we set bold, underline, italics, dim, and reverse modes correctly.
             if style.is_bold()
                 && !self.last.style.is_bold()
    -            && !bg_set
    +            && !(bg_set && !last_bg_set)
                 && self.write_command(EnterBoldMode)
             {
                 self.last.style.bold = true;

that would make the description bold as well, which would probably cause chaos.
Either way, it seems wrong to expand this hack.

Let's remove it.

For better or worse, we can't safely update the default theme yet on
an existing user's machine, because we have set universal variables.
This means that fish_color_search_match and fish_pager_color_progress on
existing installations are no longer bold. That's probably acceptable.
The former was hard to read for the longest time, until 9af6a64fd2 (Fix
bad contrast in search match highlighting, 2024-04-15). The progress info
is probably not a big deal.

Attentive users may run "fish_config theme choose 'fish default'". Perhaps
we should tell them on upgrade?

Closes #11325
2025-04-29 13:31:13 +02:00
..
2015-07-12 15:06:56 -07:00