From b5f666d467f6ddb7ed62da23cb070649e162a2ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damien=20MASCR=C3=89?= Date: Tue, 7 Jan 2020 13:20:01 +0100 Subject: [PATCH] Corrects the inclusion file list by properly interpreting the paths specified in the Include directive of the ssh_config, aka paths relative to the ~/.ssh folder. --- 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 42186e81..41d16243 100644 --- a/completion/available/ssh.completion.bash +++ b/completion/available/ssh.completion.bash @@ -15,7 +15,7 @@ _sshcomplete() { for fl in "$HOME/.ssh/config" \ $(grep "^\s*Include" "$HOME/.ssh/config" | awk '{for (i=2; i<=NF; i++) print $i}' | - sed "s|^~/|$HOME/|") + sed -re "s|^([^/~])|$HOME/.ssh/\1|" -e "s|^~/|$HOME/|") do if [ -r "$fl" ]; then COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$(grep -i ^Host "$fl" |grep -v '[*!]' | awk '{for (i=2; i<=NF; i++) print $i}' )" ${OPTIONS}) )