From e3f3b08c2e641279e80235e739c3136d8cccac49 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 18 May 2015 23:44:17 +0200 Subject: [PATCH] fix ssh remote host name completion with more than one pattern Host declaration may contain more than one pattern given after the keyword, separated by whitespaces. For correct completion split the string. Signed-off-by: Christian Hesse --- etc/zsh/zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 61246b7..be62172 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -769,7 +769,7 @@ grmlcomp() { # host completion if is42 ; then - [[ -r ~/.ssh/config ]] && _ssh_config_hosts=(${${${(@M)${(f)"$(<$HOME/.ssh/config)"}:#Host *}#Host }:#*[*?]*}) || _ssh_config_hosts=() + [[ -r ~/.ssh/config ]] && _ssh_config_hosts=(${${(s: :)${(ps:\t:)${${(@M)${(f)"$(<$HOME/.ssh/config)"}:#Host *}#Host }}}:#*[*?]*}) || _ssh_config_hosts=() [[ -r ~/.ssh/known_hosts ]] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() [[ -r /etc/hosts ]] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(