Skip to content

Documented fallback behavior for fish_pager_color_selected_background is now misleading #8787

@jaminthorns

Description

@jaminthorns

Issue

With the recent release of fish version 3.4, the fish_pager_color_selected_background variable is now set as a universal variable along with the other pager colors upon interactive initialization:

# Pager colors
__init_uvar fish_pager_color_prefix cyan --bold --underline
__init_uvar fish_pager_color_completion normal
__init_uvar fish_pager_color_description B3A06D yellow -i
__init_uvar fish_pager_color_progress brwhite --background=cyan
__init_uvar fish_pager_color_selected_background -r

It think this is a perfectly reasonable default, but in the documentation for interactive use, this is stated:

When the secondary or selected variables aren’t set, the normal variables are used, except for $fish_pager_color_selected_background, where the background of $fish_color_search_match is tried first.

This is still technically true, but because of the new initialization behavior for fish_pager_color_selected_background, this doesn't happen in practice, so the documentation is now misleading. To get the documented behavior, I can of course just run:

set -e fish_pager_color_selected_background

But the default behavior is still confusing.

Context

I'm a maintainer of the Dracula theme for fish, and in this theme, we rely on the documented behavior for fish_pager_color_selected_background (falling back to the background color of fish_color_search_match). Upon upgrading to fish version 3.4, I was confused as to why the background color of selected autocompletions had changed. Users of this theme are probably having a similar experience.

Suggested Solutions

  • Change the initialized value of fish_color_search_match to -r and remove the initialization of fish_pager_color_selected_background.

    This would change the background color of search matches to be the same as selected autocompletions and rely on the documented fallback behavior for fish_pager_color_selected_background.

  • Add a note to the documentation that fish_pager_color_selected_background is set as a universal variable by default and needs to be unset in order to have the documented fallback behavior.

    This seems like it might be exposing the "guts" of fish's initialization process too much for what is supposed to be user-friendly documentation.

  • Don't change initialization code or documentation at all, but instead inform 3rd-party theme maintainers (like myself) that fish_pager_color_selected_background now needs to be explicitly set instead of relying on the fallback behavior.

    This issue might suffice, but a page/blurb on this repository's wiki would probably be better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions