From 28e8f4582891c4e51f9270613087f66070ef84ba Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 15 Oct 2025 10:23:13 +0200 Subject: [PATCH] fish_config theme choose: correct error message for standalone builds --- share/functions/fish_config.fish | 8 ++++++-- tests/checks/fish_config.fish | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/share/functions/fish_config.fish b/share/functions/fish_config.fish index 4a9f4c931..e3fc4fbd0 100644 --- a/share/functions/fish_config.fish +++ b/share/functions/fish_config.fish @@ -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 diff --git a/tests/checks/fish_config.fish b/tests/checks/fish_config.fish index 8be28669a..23394e220 100644 --- a/tests/checks/fish_config.fish +++ b/tests/checks/fish_config.fish @@ -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