Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH _hosts: can complete hosts listed on ~/.ssh/config
- X-seq: zsh-workers 18339
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Tatsuki Sugiura <sugi@xxxxxxxxx>
- Subject: Re: PATCH _hosts: can complete hosts listed on ~/.ssh/config
- Date: Tue, 11 Mar 2003 14:53:22 +0100
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <87r89eiht2.wl@xxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <87r89eiht2.wl@xxxxxxxxx>
Tatsuki Sugiura wrote:
> Hello.
>
> Usually, "/etc/hosts" dos not contain hostname to wish to complete.
> This pactch parse ~/.ssh/config and pick up hosts listed as "Host"
> or "HostName".
Picking up hosts from a "Host" line is perhaps not wise because it can
contain ssh specific nicknames and wildcards. I'd be more inclined to
use ~/.ssh/known_hosts.
You can use a style to specify your hosts for ssh:
zstyle ':completion:*:(ssh|scp):*:my-accounts' users-hosts user@host
Or use this:
${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*}
to set the hosts style.
That said, I appreciate that it could be more intelligent out-of-the-box.
The way I envision that eventually working involves integrating with user
and port completion more flexibly than _combination and it isn't trivial.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author