Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: hostname completion for ssh / scp



> On 2016-11-05 23:53, Bart Schaefer wrote:
>
> On Nov 5,  1:29pm, Bart Schaefer wrote:
> }
> } However, because _combination is used by _ssh_hosts to also call the
> } completion for hosts, the users-hosts lookup can succeed even if the
> } users-hosts style is unset.  I don't think that was an expected effect.
> } However, I don't know the best way to address it.
> } 
> } I expected to be able to work around this by:
> } 
> } zstyle -e ':completion:*:(ssh|scp):*:my-accounts' users-hosts 'return 1'
> 
> Here's a workaround that actually works:
> 
> zstyle -e ':completion:*:(ssh|scp):*:my-accounts' users-hosts \
> 	'_hosts "$@"; trap false EXIT; return 1' 

yes,

 ssh s<TAB>

no longer jumps to first matching completion, but offers other possible
matching completions. (server1.foo.com, server2.foo.com, ...).

But it's only using /etc/hosts, and not ~/.ssh/config.












Messages sorted by: Reverse Date, Date, Thread, Author