Skip unusable paths in __fish_print_hostnames

See
https://github.com/fish-shell/fish-shell/issues/4511#issuecomment-343022740.

This would try to `cd` to ~/.ssh even if it didn't exist. That's
clearly bogus.
This commit is contained in:
Fabian Homborg 2017-12-13 13:13:34 +01:00
parent 8fb6d5db3b
commit 4ca9953114

View file

@ -62,6 +62,10 @@ function __fish_print_hostnames -d "Print a list of known hostnames"
end end
end end
# Skip unusable paths.
test -d "$relative_path" -a -x "$relative_path"
or return
builtin cd $relative_path builtin cd $relative_path
set -l new_paths set -l new_paths
for path in $paths for path in $paths