diff --git a/share/config.fish.in b/share/config.fish.in index e0ec5c323..1071a851d 100644 --- a/share/config.fish.in +++ b/share/config.fish.in @@ -44,18 +44,16 @@ end # if status --is-interactive - set -l erase_idx - for idx in (seq (count $PATH)) - set i $PATH[$idx] + set -l new_path + for i in $PATH if not test -d $i - set erase_idx $erase_idx $idx printf (_ '%s: Warning: The directory %s has been removed from your PATH because it does not exist\n') fish $i + else + set new_path $new_path $i end end - if count $erase_idx >/dev/null - set -e PATH[(echo $erase_idx)] - end + set PATH $new_path end #