From f264ee0b10f501153a470ce4bdaaeb70f1e73161 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Fri, 28 Nov 2025 13:59:07 +0100 Subject: [PATCH] webconfig theme: rename "fish-default" theme The "fish-" prefix is not needed here and it would add more noise to a following commit which adds default-{dark,light} variants that use 24 bit RGB colors. --- .../functions/__fish_config_interactive.fish | 2 +- share/functions/fish_config.fish | 2 +- .../{fish-default.theme => default.theme} | 2 +- share/tools/web_config/webconfig.py | 3 +-- tests/checks/fish_config.fish | 22 +++++++++---------- 5 files changed, 15 insertions(+), 16 deletions(-) rename share/tools/web_config/themes/{fish-default.theme => default.theme} (95%) diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish index 030abbef7..aa057054f 100644 --- a/share/functions/__fish_config_interactive.fish +++ b/share/functions/__fish_config_interactive.fish @@ -25,7 +25,7 @@ end" >$__fish_config_dir/config.fish # If we are starting up for the first time, set various defaults. if test $__fish_initialized -lt 3400 - echo yes | fish_config theme save fish-default + echo yes | fish_config theme save default set -Ue fish_color_keyword fish_color_option end if test $__fish_initialized -lt 3800 && test "$fish_color_search_match[1]" = bryellow diff --git a/share/functions/fish_config.fish b/share/functions/fish_config.fish index acfbe638d..43b32abbe 100644 --- a/share/functions/fish_config.fish +++ b/share/functions/fish_config.fish @@ -305,7 +305,7 @@ end function __fish_config_cat_theme -a theme_name switch $theme_name case 'fish default' - set theme_name fish-default + set theme_name default case 'ayu Dark' 'ayu Light' 'ayu Mirage' 'Base16 Default Dark' \ 'Base16 Default Light' 'Base16 Eighties' 'Bay Cruise' Dracula \ Fairground 'Just a Touch' Lava 'Mono Lace' 'Mono Smoke' None Nord \ diff --git a/share/tools/web_config/themes/fish-default.theme b/share/tools/web_config/themes/default.theme similarity index 95% rename from share/tools/web_config/themes/fish-default.theme rename to share/tools/web_config/themes/default.theme index ac25f9d51..4a08c0a96 100644 --- a/share/tools/web_config/themes/fish-default.theme +++ b/share/tools/web_config/themes/default.theme @@ -1,4 +1,4 @@ -# name: fish default +# name: fish default (16 color palette) fish_color_normal normal fish_color_autosuggestion brblack diff --git a/share/tools/web_config/webconfig.py b/share/tools/web_config/webconfig.py index 9ff232703..ac95e62d7 100755 --- a/share/tools/web_config/webconfig.py +++ b/share/tools/web_config/webconfig.py @@ -1123,8 +1123,7 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): output = [] output += [self.do_get_colors() | {"theme": "Current"}] output += [ - self.do_get_colors("themes/fish-default.theme") - | {"theme": "fish-default"} + self.do_get_colors("themes/default.theme") | {"theme": "default"} ] confighome = ( diff --git a/tests/checks/fish_config.fish b/tests/checks/fish_config.fish index 81e3737ca..95d2f36b8 100644 --- a/tests/checks/fish_config.fish +++ b/tests/checks/fish_config.fish @@ -121,23 +121,23 @@ diff \ (fish_config theme | psub -s config-theme) fish_config theme list | string match -r \ -'^(?:ayu-dark|base16-default-light|coolbeans|fish-default|none|'\ +'^(?:ayu-dark|base16-default-light|coolbeans|default|none|'\ 'tomorrow-night-bright|tomorrow-night|tomorrow)$' # CHECK: ayu-dark # CHECK: base16-default-light # CHECK: coolbeans -# CHECK: fish-default +# CHECK: default # CHECK: none # CHECK: tomorrow-night-bright # CHECK: tomorrow-night # CHECK: tomorrow -fish_config theme show "fish-default" +fish_config theme show "default" # 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}}{{\x1b\[4m}}fish-default{{\x1b\[m}} +# CHECK: {{\x1b\[m}}{{\x1b\[4m}}default{{\x1b\[m}} # CHECK: {{\x1b\[m}}/bright/vixens{{\x1b\[m}} {{\x1b\[36m}}jump{{\x1b\[m}} {{\x1b\[36m}}{{\x1b\[1m}}|{{\x1b\[m}} {{\x1b\[33m}}"fowl"{{\x1b\[m}} {{\x1b\[36m}}{{\x1b\[1m}}> quack{{\x1b\[m}} {{\x1b\[32m}}&{{\x1b\[m}}{{\x1b\[31m}} # This is a comment # 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 @@ -148,16 +148,16 @@ fish_config theme show ayu-dark ayu-light | string match -r '^.*ayu.*' mkdir $__fish_config_dir/themes touch $__fish_config_dir/themes/custom-from-userconf.theme -fish_config theme show | grep -E 'fish-default|default-dark|custom-from-userconf' +fish_config theme show | grep -E '[^-]default|default-dark|custom-from-userconf' # CHECK: {{.*}}custom-from-userconf{{\x1b\[m}} # CHECK: {{.*}}base16-default-dark{{\x1b\[m}} -# CHECK: {{.*}}fish-default{{\x1b\[m}} +# CHECK: {{.*}}default{{\x1b\[m}} # Override a default theme with different colors. __fish_data_with_file tools/web_config/themes/none.theme \ - cat >$__fish_config_dir/themes/fish-default.theme -fish_config theme show | grep -E 'fish-default|base16-default-dark' -A1 -# CHECK: {{\x1b\[m}}{{\x1b\[4m}}fish-default{{\x1b\[m}} + cat >$__fish_config_dir/themes/default.theme +fish_config theme show | grep -E '[^-]default|base16-default-dark' -A1 +# CHECK: {{\x1b\[m}}{{\x1b\[4m}}default{{\x1b\[m}} # CHECK: {{\x1b\[m}}/bright/vixens{{\x1b\[m}} {{\x1b\[m}}jump{{\x1b\[m}}{{.*}} # CHECK: -- # CHECK: {{\x1b\[m}}{{\x1b\[4m}}base16-default-dark{{\x1b\[m}} @@ -189,7 +189,7 @@ echo >$__fish_config_dir/themes/custom-from-userconf.theme \ # CHECK: $fish_color_normal: set in universal scope, unexported, with 1 elements # CHECK: $fish_color_normal[1]: |yellow| - fish_config theme choose 'fish-default' + fish_config theme choose 'default' print-sample-colors # CHECK: normal=normal # CHECK: autosuggestion=brblack @@ -200,7 +200,7 @@ echo >$__fish_config_dir/themes/custom-from-userconf.theme \ # CHECK: $fish_color_normal: set in universal scope, unexported, with 1 elements # CHECK: $fish_color_normal[1]: |yellow| - echo yes | fish_config theme save 'fish-default' + echo yes | fish_config theme save 'default' set -S fish_color_normal # CHECK: $fish_color_normal: set in universal scope, unexported, with 1 elements # CHECK: $fish_color_normal[1]: |normal|