diff --git a/CHANGES b/CHANGES index 95069163..0aa57db5 100644 --- a/CHANGES +++ b/CHANGES @@ -36,6 +36,8 @@ bash-completion (1.x) * Improve qemu completion (Debian: #534901) * Added sshfs completion (shares the same as scp) (Debian: #545978) * Fixed obvious brokenness (typos) in contrib/mdadm + * Clean [1.2.3.4]:port format in known_hosts, thanks to + Xuefer (Gentoo: #284563) * Patches from PLD Linux (thanks to Elan Ruusamäe): - avoid sed pipe as ps itself can omit the headers - improve service(8) completion, also look for "msg_usage" diff --git a/bash_completion b/bash_completion index 0e5bca78..9623ffaf 100644 --- a/bash_completion +++ b/bash_completion @@ -1172,6 +1172,8 @@ _known_hosts_real() COMPREPLY=( $( awk 'BEGIN {FS=","} /^\s*[^|\#]/ {for (i=1; i<=2; ++i) { \ gsub(" .*$", "", $i); \ + gsub("[\\[\\]]", "", $i); \ + gsub(":[0-9]+$", "", $i); \ if ($i ~ /'"$awkcur"'/) {print $i} \ }}' "${kh[@]}" 2>/dev/null ) ) fi