From dabd9b89013778555b294e398e10a71fc35acbfd Mon Sep 17 00:00:00 2001 From: santi Date: Wed, 19 Oct 2011 10:31:12 -0300 Subject: [PATCH] fix ssh autocompletion to ignore port info from knonw_hosts files --- lib/completion.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index b3cc91822..99beb2699 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -32,7 +32,7 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir cdpath=(.) # use /etc/hosts and known_hosts for hostname completion -[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() +[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}##\[}%%]:*}) || _ssh_hosts=() [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(