Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: autocompletion with ssh and .ssh/config
- X-seq: zsh-workers 28088
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: autocompletion with ssh and .ssh/config
- Date: Sun, 18 Jul 2010 19:21:30 +0100
- In-reply-to: <AANLkTilb8o0zusxIkGj1kEDP74JtcwatdWbUtnOUYJHd@xxxxxxxxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <AANLkTikyZ8XZ_A8yGIQN2PRSXoA1Un6ZNdI6GLDzQpNN@xxxxxxxxxxxxxx> <alpine.LNX.2.01.1007180109520.14779@xxxxxxxxxxx> <AANLkTilb8o0zusxIkGj1kEDP74JtcwatdWbUtnOUYJHd@xxxxxxxxxxxxxx>
On Sun, 18 Jul 2010 10:51:32 +0200
Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> On 18 July 2010 07:21, Benjamin R. Haskell <zsh@xxxxxxxxxx> wrote:
> > On Sun, 18 Jul 2010, David Duponchel wrote:
> >> I have some hosts defined in my .ssh/config file. Example :
> >> Host bar
> >> HostName 1.2.3.4
> >>
> >> Host baz
> >> HostName 2.3.4.5
> >>
> >> When I type ssh <tab>, only my users and hosts in /etc/hosts are
> >> displayed (my .ssh/config is ignored).
> >> With ssh ba<tab> the autocompletion is correctly done and propose bar
> >> and baz.
> >
> > Host from ~/.ssh/config aren't proposed until hosts found from other
> > methods are exhausted. The biggest reason that seems wrong (IMO) is
> > that 'other methods' includes ~/.ssh/known_hosts. So, a host I've never
> > ssh'ed to won't be offered until I've ssh'ed to it.
>
> Here's the commit that introduced the &&returns,
> http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=commitdiff;h=7072c10ae223e24f601b3
... which contains little useful information but at least refers to where
the information is. The correct reference is zsh-users/11333:
http://www.zsh.org/mla/users/2007/msg00233.html
This fixed a problem that user@... completed machines that weren't
associated with that username even though the association is explicit.
The problem seems to be that user completion is being assumed even if it
hasn't happened, i.e. user@host completion is treated as succesful even
if there's no user@ bit.
The fix would be to separate these cases, i.e. ensure the return only
happens if a user was actually matched. Simply removing the returns
would reintroduce the user-host completion bug. I haven't probed any
deeper, but presumably _combination isn't up to the job on its own, and
it'll need an extra test somewhere. Examination suggests the problem's
probably in the second branch, where there's no existing "@". However,
I can't see offhand what the command is trying to do.
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author