$ ssh user@<TAB> sometimes [1.2.3.4] or [1.2.3.4]:1234 is yield, i don't think []: is a known host i'm not sure in which case will ssh add [] to ~/.ssh/known_hosts, but it did diff -u /usr/share/bash-completion/base-old /usr/share/bash-completion/base --- /usr/share/bash-completion/base-old 2009-09-11 15:54:09.000000000 +0800 +++ /usr/share/bash-completion/base 2009-09-11 15:54:13.000000000 +0800 @@ -2234,6 +2234,8 @@ COMPREPLY=( $( awk 'BEGIN {FS=","} /^\s*[^|\#]/ {for (i=1; i<=2; ++i) { \ gsub(" .*$", "", $i); \ + gsub("[\\[\\]]", "", $i); \ + gsub(":[0-9]+$", "", $i); \ if ($i ~ /'$cur'/) {print $i} \ }}' "${kh[@]}" 2>/dev/null ) ) fi
Created attachment 203767 [details, diff] patch for "base" that remove [] and :port
This part of the code has changed substantially since 1.0 release in upstream trunk. Would you mind filing an upstream bug so it has a chance of getting included in the 1.1 release which is slated to be done in 2 weeks. http://bash-completion.alioth.debian.org/#bugs
yeah, it changed a lot. but lines around my fix hasn't changed patch against latest trunk from git diff --git a/bash_completion b/bash_completion index 07fe78c..1b55a97 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 i have registered a new account in their bug report system, verifying with email, got: """ Error Could Not Get User"""
Created attachment 204280 [details] updated patch against bash completion 1.1 gentoo "/etc/bash-completion.d/base" is actually /etc/bash-completion from upstream package
Thanks, I still wonder under what conditions you get [foo] in your known_hosts file.
(In reply to comment #5) > Thanks, I still wonder under what conditions you get [foo] in your known_hosts > file. > Ah, found it. the brackets are needed for ipv6.. Your patch is applied. I'm going to close this bug because since 1.0 was released you are the first person to report it and you already fixed it locally :) I'm anxious for 1.1 so you can expect to see that almost immediately after release. 16:07 < CIA-2> d.paleino * rf061b21 bash-completion/ (CHANGES bash_completion): Clean [1.2.3.4]:port format in known_hosts, thanks to Xuefer (Gentoo: #284563)