diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5ab437839..1e422241a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,10 +14,6 @@ Deprecations and removed features - You can still opt into storing color variables in the universal scope via ``fish_config theme save`` though unlike ``fish_config theme choose``, it does not support dynamic theme switching based on the terminal's color theme (see below). -- Erasing a color variable (e.g. by running ``set --erase fish_color_command``) - no longer prevents fish from overwriting it with the default theme's version. - To set a color to its fallback value (which is :envvar:`fish_color_normal` for most colors), - set it to an empty list (``set fish_color_command``) or an equivalent (``set fish_color_command normal``). - In addition to setting the variables which are explicitly defined in the given theme, ``fish_config theme choose`` now clears only color variables that were set by earlier invocations of a ``fish_config theme choose`` command (which is how fish's default theme is set). diff --git a/share/functions/fish_config.fish b/share/functions/fish_config.fish index 7e0e6c7fc..b37c07d5e 100644 --- a/share/functions/fish_config.fish +++ b/share/functions/fish_config.fish @@ -377,7 +377,9 @@ function __fish_config_theme_choose end end if test -n "$fish_terminal_color_theme" || not $need_hook - if not set -q _flag_no_override[1] + if set -q _flag_no_override[1] + __fish_apply_theme + else __fish_override=true __fish_apply_theme end end diff --git a/tests/checks/fish_config.fish b/tests/checks/fish_config.fish index df925d4f0..078b72f61 100644 --- a/tests/checks/fish_config.fish +++ b/tests/checks/fish_config.fish @@ -111,9 +111,9 @@ fish_config theme choose non-existent-theme1 # This still demos the current theme. fish_config theme show non-existent-theme2 # CHECK: {{\x1b\[m}}{{\x1b\[4m}}Current{{\x1b\[m}} -# CHECK: /bright/vixens{{\x1b\[m}} jump{{\x1b\[m}} |{{\x1b\[m}} "fowl"{{\x1b\[m}} > quack{{\x1b\[m}} &{{\x1b\[m}} # This is a comment -# CHECK: {{\x1b\[m}}echo{{\x1b\[m}} 'Errors are the portal to discovery -# CHECK: {{\x1b\[m}}Th{{\x1b\[m}}is an autosuggestion +# CHECK: {{\x1b\[m/bright/vixens\x1b\[m \x1b\[36mjump\x1b\[m.*}} +# CHECK: {{.*}} +# CHECK: {{.*}} diff \ (fish_config theme list | psub -s config-theme-list) \ @@ -132,9 +132,9 @@ fish_config theme list | string match -r \ fish_config theme show default-rgb # CHECK: {{\x1b\[m}}{{\x1b\[4m}}Current{{\x1b\[m}} -# CHECK: /bright/vixens{{\x1b\[m}} jump{{\x1b\[m}} |{{\x1b\[m}} "fowl"{{\x1b\[m}} > quack{{\x1b\[m}} &{{\x1b\[m}} # This is a comment -# CHECK: {{\x1b\[m}}echo{{\x1b\[m}} 'Errors are the portal to discovery -# CHECK: {{\x1b\[m}}Th{{\x1b\[m}}is an autosuggestion +# CHECK: {{\x1b\[m/bright/vixens\x1b\[m \x1b\[36mjump\x1b\[m.*}} +# CHECK: {{\x1b\[m}}{{\x1b\[m}}echo{{\x1b\[m}} {{\x1b\[91m}}'{{\x1b\[33m}}Errors are the portal to discovery +# CHECK: {{\x1b\[m}}{{\x1b\[m}}Th{{\x1b\[m}}{{\x1b\[90m}}is an autosuggestion # CHECK: {{\x1b\[m\x1b\[4mdefault-rgb \(light color theme\)\x1b\[m}} # CHECK: {{\x1b\[38;2;0;0;238m/bright/vixens\x1b\[m \x1b\[38;2;0;160;160mjump\x1b.*}} @@ -181,10 +181,9 @@ echo >$__fish_config_dir/themes/custom-from-userconf.theme \ "fish_color_normal yellow" { - # Since we're noninteractive, we have not loaded a theme yet. print-sample-colors - # CHECK: normal= - # CHECK: autosuggestion= + # CHECK: normal=normal --theme=default + # CHECK: autosuggestion=brblack --theme=default fish_config theme choose custom-from-userconf --color-theme=unknown print-sample-colors