diff --git a/share/functions/fish_config.fish b/share/functions/fish_config.fish index eda47d83d..2892b7d44 100644 --- a/share/functions/fish_config.fish +++ b/share/functions/fish_config.fish @@ -125,13 +125,11 @@ function fish_config --description "Launch fish's web based configuration" end set -l found false - for f in $prompt_dir/$argv[1].fish - if test -f $f - __fish_config_prompt_choose - source $f - set found true - break - end + set -l f $prompt_dir/$argv[1].fish + if set -q f[1] && test -f $f + __fish_config_prompt_choose + source $f + set found true end if not $found if status list-files tools/web_config/sample_prompts/$argv[1].fish &>/dev/null @@ -160,18 +158,17 @@ function fish_config --description "Launch fish's web based configuration" set -l have if set -q argv[1] - for f in $prompt_dir/$argv[1].fish - if test -f $f - set have $f - # Set the functions to empty so we empty the file - # if necessary. - function fish_prompt - end - function fish_right_prompt - end - source $f - or return 2 + set -l f $prompt_dir/$argv[1].fish + if set -q f[1] && test -f $f + set have $f + # Set the functions to empty so we empty the file + # if necessary. + function fish_prompt end + function fish_right_prompt + end + source $f + or return 2 end if not set -q have[1] if status list-files tools/web_config/sample_prompts/$argv[1].fish &>/dev/null