From 4ca995311460bf41e0fc06690f5770f61d5d5c02 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 13 Dec 2017 13:13:34 +0100 Subject: [PATCH] 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. --- share/functions/__fish_print_hostnames.fish | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/functions/__fish_print_hostnames.fish b/share/functions/__fish_print_hostnames.fish index 855ff5d9d..aabbf0f65 100644 --- a/share/functions/__fish_print_hostnames.fish +++ b/share/functions/__fish_print_hostnames.fish @@ -62,6 +62,10 @@ function __fish_print_hostnames -d "Print a list of known hostnames" end end + # Skip unusable paths. + test -d "$relative_path" -a -x "$relative_path" + or return + builtin cd $relative_path set -l new_paths for path in $paths