fish_config theme choose: correct error message for standalone builds

This commit is contained in:
Johannes Altmanninger
2025-10-15 10:23:13 +02:00
parent ac8ef4da9e
commit 28e8f45828
2 changed files with 11 additions and 3 deletions

View File

@@ -285,8 +285,12 @@ fish_pager_color_secondary_description
# Otherwise, we'll persist the currently loaded/themed variables (in case of `theme save`).
set -l theme_path (__fish_config_list_themes $argv[1])[1]
if not set -q theme_path[1]
echo "No such theme: $argv[1]" >&2
echo "Searched directories:" (__fish_config_theme_dirs) >&2
echo >&2 "No such theme: $argv[1]"
echo >&2 Searched (__fish_config_theme_dirs) (
if not set -q __fish_data_dir[1]
echo "and `status list-files tools/web_config/themes`"
end
)
return 1
end

View File

@@ -88,8 +88,12 @@ type fish_prompt fish_right_prompt fish_mode_prompt |
# CHECK: function fish_mode_prompt {{.*}}
# CHECK: # {{.*}}
fish_config theme choose non-existent-theme1
# CHECKERR: No such theme: non-existent-theme1
# CHECKERR: Searched {{/\S* (/\S*|and `status list-files tools/web_config/themes`)}}
# This still demos the current theme.
fish_config theme show non-existent-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