diff --git a/bash_completion b/bash_completion index 1d57de3a83b..1b55447b0eb 100644 --- a/bash_completion +++ b/bash_completion @@ -1922,7 +1922,7 @@ _known_hosts_real() local -a hosts=($(command sed -ne 's/^[[:blank:]]*[Hh][Oo][Ss][Tt][[:blank:]=]\{1,\}\(.*\)$/\1/p' "${config[@]}")) if ((${#hosts[@]} != 0)); then COMPREPLY+=($(compgen -P "$prefix" \ - -S "$suffix" -W '"${hosts[@]%%[*?%]*}"' -X '\!*' -- "$cur")) + -S "$suffix" -W '"${hosts[@]%%[*?%]*}"' -X '@(\!*|)' -- "$cur")) fi fi diff --git a/test/fixtures/_known_hosts_real/config b/test/fixtures/_known_hosts_real/config index 513f02fdbbc..85f06790af9 100644 --- a/test/fixtures/_known_hosts_real/config +++ b/test/fixtures/_known_hosts_real/config @@ -1,6 +1,8 @@ UserKnownHostsFile _known_hosts_real/known_hosts # Unindented +Host * + IPQoS none Host gee* jar?this-part-we-do-not-complete-at-least-yet HostName %h.example.com # Indented, with = separator