From f116a81250a46493267a2a6ceb8f6b086a346cbf Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Tue, 25 Jul 2023 16:42:24 +0200 Subject: [PATCH] Make default theme use named colors only This gives us the biggest chance that these are *visible* in the terminal, which allows people to choose something nicer. It changes two colors - the autosuggestion and the pager description (i.e. the completion descriptions in the pager). In a bunch of terminals I've tested these are pretty similar - for the most part brblack for the suggestions is a bit brighter than 555, and yellow for the descriptions is less blue than the original. We could also make the descriptions brblack, but that's for later. Technically we are a bit naughty in having a few foreground and background pairs that might not be visible, but there's nothing we can do if someone makes white invisible on brblack. Fixes #9913 Fixes #3443 (cherry picked from commit ed881bcdd8d7351c5b48daf22ca6e3d9344c2d5d) --- share/functions/__fish_config_interactive.fish | 10 ++++++---- share/tools/web_config/themes/fish default.theme | 7 +++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish index a0872ac5b..ccb84dce8 100644 --- a/share/functions/__fish_config_interactive.fish +++ b/share/functions/__fish_config_interactive.fish @@ -31,6 +31,10 @@ if status is-interactive end" >$__fish_config_dir/config.fish # Regular syntax highlighting colors + # NOTE: These should only use named colors + # to give us the maximum chance they are + # visible in whatever terminal setup. + # __init_uvar fish_color_normal normal __init_uvar fish_color_command blue __init_uvar fish_color_param cyan @@ -41,7 +45,7 @@ end" >$__fish_config_dir/config.fish __init_uvar fish_color_operator brcyan __init_uvar fish_color_end green __init_uvar fish_color_quote yellow - __init_uvar fish_color_autosuggestion 555 brblack + __init_uvar fish_color_autosuggestion brblack __init_uvar fish_color_user brgreen __init_uvar fish_color_host normal __init_uvar fish_color_host_remote yellow @@ -57,14 +61,12 @@ end" >$__fish_config_dir/config.fish # Background color for selections __init_uvar fish_color_selection white --bold --background=brblack - # XXX fish_color_cancel was added in 2.6, but this was added to post-2.3 initialization - # when 2.4 and 2.5 were already released __init_uvar fish_color_cancel -r # Pager colors __init_uvar fish_pager_color_prefix normal --bold --underline __init_uvar fish_pager_color_completion normal - __init_uvar fish_pager_color_description B3A06D yellow -i + __init_uvar fish_pager_color_description yellow -i __init_uvar fish_pager_color_progress brwhite --background=cyan __init_uvar fish_pager_color_selected_background -r diff --git a/share/tools/web_config/themes/fish default.theme b/share/tools/web_config/themes/fish default.theme index 380ed306d..d6cacbf5e 100644 --- a/share/tools/web_config/themes/fish default.theme +++ b/share/tools/web_config/themes/fish default.theme @@ -1,4 +1,7 @@ # name: fish default +# NOTE: These should only use named colors +# to give us the maximum chance they are +# visible in whatever terminal setup. fish_color_normal normal fish_color_command blue @@ -18,10 +21,10 @@ fish_color_cwd green fish_color_valid_path --underline fish_color_cwd_root red fish_color_user brgreen -fish_color_autosuggestion 555 brblack +fish_color_autosuggestion brblack fish_pager_color_completion normal fish_color_host normal -fish_pager_color_description B3A06D yellow -i +fish_pager_color_description yellow -i fish_color_cancel -r fish_pager_color_prefix normal --bold --underline fish_pager_color_progress brwhite --background=cyan