From 9df9ac3dec5f82bdc4e869763751fb1a83d64de6 Mon Sep 17 00:00:00 2001 From: Nils Winkler Date: Tue, 25 Oct 2011 08:57:39 +0200 Subject: [PATCH] Fixed SSH completion to include both config and known_hosts. Works on OS X for me if set up like that. --- completion/available/ssh.completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completion/available/ssh.completion.bash b/completion/available/ssh.completion.bash index 30fd65d..ea49026 100644 --- a/completion/available/ssh.completion.bash +++ b/completion/available/ssh.completion.bash @@ -13,7 +13,7 @@ _sshcomplete() { # parse all hosts found in .ssh/known_hosts if [ -r $HOME/.ssh/known_hosts ]; then if grep -v -q -e '^ ssh-rsa' $HOME/.ssh/known_hosts ; then - COMPREPLY=( $COMPREPLY $(compgen -W "$( awk '{print $1}' $HOME/.ssh/known_hosts | cut -d, -f 1 | sed -e 's/\[//g' | sed -e 's/\]//g' | cut -d: -f1 | grep -v ssh-rsa)" -- ${COMP_WORDS[COMP_CWORD]} )) + COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$( awk '{print $1}' $HOME/.ssh/known_hosts | cut -d, -f 1 | sed -e 's/\[//g' | sed -e 's/\]//g' | cut -d: -f1 | grep -v ssh-rsa)" -- ${COMP_WORDS[COMP_CWORD]} )) fi fi -- 2.17.1