fish_config theme choose: fix Tomorrow always using light version

The backward compat hack canonicalization caused us to always treat
"tomorrow" light theme.

Restrict this hack to the legacy name (Tomorrow); don't do it when
the new canonical name (tomorrow) is used.  The same issue does not
affect other themes because their legacy names always have a "light"
or 'dark' suffix, which means that the canonical name is different,
so the legacy hacks don't affect the canonical name.

Fixes #12266
This commit is contained in:
Johannes Altmanninger
2026-01-04 12:41:31 +01:00
parent d1ed582919
commit 85ac91eb2b
2 changed files with 4 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ This release fixes the following problems identified in fish 4.3.0:
- Selecting a completion could insert only part of the token (:issue:`12249`).
- Glitch with soft-wrapped autosuggestions and :doc:`cmds/fish_right_prompt` (:issue:`12255`).
- Spurious echo in tmux when typing a command really fast (:issue:`12261`).
- ``tomorrow`` theme always using the light variant (:issue:`12266`).
- The sample prompts and themes are correctly installed (:issue:`12241`).
- Last line of command output could be hidden when missing newline (:issue:`12246`).

View File

@@ -401,6 +401,9 @@ function __fish_config_theme_canonicalize --no-scope-shadowing
None Nord 'Old School' Seaweed 'Snow Day' \
'Solarized Dark' 'Solarized Light' \
'Tomorrow Night Bright' 'Tomorrow Night' Tomorrow
if test $theme_name = Tomorrow
set color_theme light
end
set theme_name (string lower (string replace -a " " "-" $theme_name))
end
switch $theme_name
@@ -409,8 +412,6 @@ function __fish_config_theme_canonicalize --no-scope-shadowing
base16-default-dark base16-default-light \
solarized-dark solarized-light
string match -rq -- '^(?<theme_name>.*)-(?<color_theme>dark|light)$' $theme_name
case tomorrow
set color_theme light
case tomorrow-night
set theme_name tomorrow
set color_theme dark