themes/default: revert to palette colors for now

The readability concern in ed881bcdd8 (Make default theme use named
colors only, 2023-07-25) was no longer relevant, but people might
prefer we use terminal colors by default, because other apps do too,
and because it's a well-known way to make colors look good across
both dark and light mode.

If we revert this, we should make sure fish_default_mode_prompt.fish
and prompt_login.fish also use RGB colors
This commit is contained in:
Johannes Altmanninger
2025-12-27 11:51:39 +01:00
parent 92db03ac9f
commit 4bb0d956eb
5 changed files with 113 additions and 82 deletions

View File

@@ -7,7 +7,8 @@ function __fish_theme_for_each
set -l matching_names (__fish_theme_names $theme_names)
if not set -q theme_names[1]
echo default
string match -v -- default $matching_names
echo default-rgb
string match -rv -- '^(default|default-rgb)$' $matching_names
else
string join -- \n $matching_names
end

View File

@@ -0,0 +1,100 @@
# name: fish default
[light]
# preferred_background: ffffff
fish_color_normal 000000
fish_color_autosuggestion 7f7f7f
fish_color_cancel ffffff --background=000000
fish_color_command 0000ee
fish_color_comment cd0000
fish_color_cwd 00cd00
fish_color_cwd_root cd0000
fish_color_end 00cd00
fish_color_error ff0000
fish_color_escape 00cdcd
fish_color_history_current --bold
fish_color_host 000000
fish_color_host_remote a0a000
# fish_color_keyword $fish_color_command
fish_color_operator 00cdcd
# fish_color_option $fish_color_param
fish_color_param 00a0a0
fish_color_quote a0a000
fish_color_redirection 00a0a0 --bold
fish_color_search_match 060606 --bold --background=cdcdcd
fish_color_selection 060606 --bold --background=cdcdcd
fish_color_status cd0000
fish_color_user 00cd00
fish_color_valid_path --underline
fish_pager_color_description a0a000 --italics
fish_pager_color_prefix 000000 --bold --underline
fish_pager_color_progress ffffff --background=00a0a0 --bold
fish_pager_color_selected_background --background=cdcdcd
fish_pager_color_selected_prefix 060606 --bold
fish_pager_color_selected_completion 060606 --bold
fish_pager_color_selected_description 060606 --bold --italics
[dark]
# preferred_background: 000000
fish_color_normal ffffff
fish_color_autosuggestion 9f9f9f
fish_color_cancel 000000 --background=ffffff
fish_color_command 5c5cff
fish_color_comment cd5c5c
fish_color_cwd 00ff00
fish_color_cwd_root 00cd00
fish_color_end 00ff00
fish_color_error ff0000
fish_color_escape 00ffff
fish_color_history_current --bold
fish_color_host ffffff
fish_color_host_remote cdcd00
# fish_color_keyword $fish_color_command
fish_color_operator 00ffff
# fish_color_option $fish_color_param
fish_color_param 00cdcd
fish_color_quote cdcd00
fish_color_redirection 00cdcd --bold
fish_color_search_match ffffff --bold --background=7f7f7f
fish_color_selection ffffff --bold --background=7f7f7f
fish_color_status 00cd00
fish_color_user 00ff00
fish_color_valid_path --underline
fish_pager_color_description cdcd00 --italics
fish_pager_color_prefix ffffff --bold --underline
fish_pager_color_progress ffffff --background=00cdcd --bold
fish_pager_color_selected_background --background=7f7f7f
fish_pager_color_selected_prefix ffffff --bold
fish_pager_color_selected_completion ffffff --bold
fish_pager_color_selected_description ffffff --bold --italics"
[unknown]
# 16 color palette
fish_color_normal normal
fish_color_autosuggestion brblack
fish_color_cancel -r
fish_color_command normal
fish_color_comment red
fish_color_cwd green
fish_color_cwd_root red
fish_color_end green
fish_color_error brred
fish_color_escape brcyan
fish_color_history_current --bold
fish_color_host normal
fish_color_host_remote yellow
# fish_color_keyword $fish_color_command
fish_color_operator brcyan
# fish_color_option $fish_color_param
fish_color_param cyan
fish_color_quote yellow
fish_color_redirection cyan --bold
fish_color_search_match white --background=brblack --bold
fish_color_selection white --background=brblack --bold
fish_color_status red
fish_color_user brgreen
fish_color_valid_path --underline
fish_pager_color_description yellow --italics
fish_pager_color_prefix normal --bold --underline
fish_pager_color_progress brwhite --background=cyan --bold
fish_pager_color_selected_background -r

View File

@@ -1,75 +1,5 @@
# name: fish default
# name: fish default (terminal colors)
[light]
# preferred_background: ffffff
fish_color_normal 000000
fish_color_autosuggestion 7f7f7f
fish_color_cancel ffffff --background=000000
fish_color_command 0000ee
fish_color_comment cd0000
fish_color_cwd 00cd00
fish_color_cwd_root cd0000
fish_color_end 00cd00
fish_color_error ff0000
fish_color_escape 00cdcd
fish_color_history_current --bold
fish_color_host 000000
fish_color_host_remote a0a000
# fish_color_keyword $fish_color_command
fish_color_operator 00cdcd
# fish_color_option $fish_color_param
fish_color_param 00a0a0
fish_color_quote a0a000
fish_color_redirection 00a0a0 --bold
fish_color_search_match 060606 --bold --background=cdcdcd
fish_color_selection 060606 --bold --background=cdcdcd
fish_color_status cd0000
fish_color_user 00cd00
fish_color_valid_path --underline
fish_pager_color_description a0a000 --italics
fish_pager_color_prefix 000000 --bold --underline
fish_pager_color_progress ffffff --background=00a0a0 --bold
fish_pager_color_selected_background --background=cdcdcd
fish_pager_color_selected_prefix 060606 --bold
fish_pager_color_selected_completion 060606 --bold
fish_pager_color_selected_description 060606 --bold --italics
[dark]
# preferred_background: 000000
fish_color_normal ffffff
fish_color_autosuggestion 9f9f9f
fish_color_cancel 000000 --background=ffffff
fish_color_command 5c5cff
fish_color_comment cd5c5c
fish_color_cwd 00ff00
fish_color_cwd_root 00cd00
fish_color_end 00ff00
fish_color_error ff0000
fish_color_escape 00ffff
fish_color_history_current --bold
fish_color_host ffffff
fish_color_host_remote cdcd00
# fish_color_keyword $fish_color_command
fish_color_operator 00ffff
# fish_color_option $fish_color_param
fish_color_param 00cdcd
fish_color_quote cdcd00
fish_color_redirection 00cdcd --bold
fish_color_search_match ffffff --bold --background=7f7f7f
fish_color_selection ffffff --bold --background=7f7f7f
fish_color_status 00cd00
fish_color_user 00ff00
fish_color_valid_path --underline
fish_pager_color_description cdcd00 --italics
fish_pager_color_prefix ffffff --bold --underline
fish_pager_color_progress ffffff --background=00cdcd --bold
fish_pager_color_selected_background --background=7f7f7f
fish_pager_color_selected_prefix ffffff --bold
fish_pager_color_selected_completion ffffff --bold
fish_pager_color_selected_description ffffff --bold --italics"
[unknown]
# 16 color palette
fish_color_normal normal
fish_color_autosuggestion brblack
fish_color_cancel -r

View File

@@ -19,7 +19,7 @@ echo no default universal variables
# Existing universal variables are migrated as-is.
{
echo yes | fish_config theme save default --color-theme=light
echo yes | fish_config theme save default-rgb --color-theme=light
fake-old-uvars
set -U fish_key_bindings fish_vi_key_bindings
set -U | head -2
@@ -60,7 +60,7 @@ echo no default universal variables
# If existing universal colors match old defaults exactly (common case), don't migrate but
# delete them.
{
echo yes | fish_config theme save default --color-theme=unknown
echo yes | fish_config theme save default
fake-old-uvars
provoke-migration
$fish -c __fish_theme_migrate

View File

@@ -131,21 +131,21 @@ fish_config theme list | string match -r \
# CHECK: tomorrow-night-bright
# CHECK: tomorrow
fish_config theme show default
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\x1b\[4mdefault \(light color theme\)\x1b\[m}}
# 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.*}}
# CHECK: {{.*}}
# CHECK: {{.*}}
# CHECK: {{\x1b\[m\x1b\[4mdefault \(dark color theme\)\x1b\[m}}
# CHECK: {{\x1b\[m\x1b\[4mdefault-rgb \(dark color theme\)\x1b\[m}}
# CHECK: {{\x1b\[38;2;92;92;255m.*}}
# CHECK: {{.*}}
# CHECK: {{.*}}
# CHECK: {{\x1b\[m\x1b\[4mdefault \(unknown color theme\)\x1b\[m}}
# CHECK: {{\x1b\[m\x1b\[4mdefault-rgb \(unknown color theme\)\x1b\[m}}
# CHECK: {{\x1b\[m/bright/vixens\x1b\[m \x1b\[36mjump\x1b\[m.*}}
# CHECK: {{.*}}
# CHECK: {{.*}}
@@ -156,10 +156,10 @@ fish_config theme show ayu | string match -r '^.*ayu.*'
mkdir $__fish_config_dir/themes
touch $__fish_config_dir/themes/custom-from-userconf.theme
fish_config theme show | grep -E 'default|base16-default|custom-from-userconf'
# CHECK: {{.*}}default (light color theme){{\x1b\[m}}
# CHECK: {{.*}}default (dark color theme){{\x1b\[m}}
# CHECK: {{.*}}default (unknown color theme){{\x1b\[m}}
fish_config theme show | grep -E 'default-rgb|base16-default|custom-from-userconf'
# CHECK: {{.*}}default-rgb (light color theme){{\x1b\[m}}
# CHECK: {{.*}}default-rgb (dark color theme){{\x1b\[m}}
# CHECK: {{.*}}default-rgb (unknown color theme){{\x1b\[m}}
# CHECK: {{.*}}custom-from-userconf (unknown color theme){{\x1b\[m}}
# CHECK: {{.*}}base16-default (light color theme){{\x1b\[m}}
# CHECK: {{.*}}base16-default (dark color theme){{\x1b\[m}}