fix ssh-completion error

This commit is contained in:
Jakobus Schürz 2020-02-27 09:08:43 +01:00
parent dcd10f3301
commit 572f73fd2e
4 changed files with 18 additions and 3 deletions

View file

@ -1,2 +1,2 @@
. /usr/share/bash-completion/completions/ssh
#. /usr/share/bash-completion/completions/ssh
shopt -u hostcomplete && complete -F _ssh sshmyshellconfig

View file

@ -1,2 +1,2 @@
. /usr/share/bash-completion/completions/ssh
#. /usr/share/bash-completion/completions/ssh
shopt -u hostcomplete && complete -F _ssh sshs

View file

@ -1,2 +1,2 @@
. /usr/share/bash-completion/completions/ssh
#. /usr/share/bash-completion/completions/ssh
shopt -u hostcomplete && complete -F _ssh sshserverconfig

View file

@ -76,6 +76,21 @@ EOF
fi
}
# Check for interactive bash and that we haven't already been sourced.
if [ -n "${BASH_VERSION-}" -a -n "${PS1-}" -a -z "${BASH_COMPLETION_VERSINFO-}" ]; then
# Check for recent enough version of bash.
if [ ${BASH_VERSINFO[0]} -gt 4 ] || \
[ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then
[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \
. "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
if shopt -q progcomp && [ -r /usr/share/bash-completion/bash_completion ]; then
# Source completion code.
. /usr/share/bash-completion/bash_completion
fi
fi
fi
# source git-sync part of myshellconfig