zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: problems with ssh tab completion
Date: Mon, 09 Oct 2006 08:01:16 -0700	[thread overview]
Message-ID: <061009080116.ZM6500@torch.brasslantern.com> (raw)
In-Reply-To: <20061009023729.GA6361@localhost.localdomain>

On Oct 9,  4:37am, Stanislaw Halik wrote:
>
> Any hints?

Firstly, note that there are some long-standing problems with completion
for ssh which stem from a deeper issue with the completion system.  See
zsh-workers/16598 and surrounding thread, from way back in 2002.

However, I *think* the problems you are describing come from using the
matcher-list zstyle that allows partial completion within words.  When
you have this style set, the completion system discovers that all the
hostname matches contain a dot, so it inserts one and then places the
cursor at one of the positions where typing something disambiguates
the results.  The position it chooses may not be the one you expect;
I think it chooses the rightmost one, where the leftmost might be more
intuitive.

In the case of

> % ssh username@.

you didn't show us the list of matches, so I can't guess why only one
dot appears and the cursor is after it.  In this example, though:

> ~% ssh sthalik@ro..pl
> remote host name
> rodney.ltd.pl            rollercoaster.insane.pl

with the cursor between the dots, all you need to do is type either an
"l" (for "ltd") or an "i" (for "insane") and that will disambiguate the
match and allow a single additional TAB to expand the entire hostname.

If you find this useful elsewhere, such as in file names, but not in
ssh, you can change the matcher-list style just for ssh with another
zstyle command such as:

    zstyle ':completion:*:(ssh|scp):*' matcher-list ''

As for why it only happens when the username is more than four characters
long, I suspect that has to do with the set of hostnames that can complete
with the short user names, rather than anything more mysterious.


  reply	other threads:[~2006-10-09 15:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-09  2:37 Stanislaw Halik
2006-10-09 15:01 ` Bart Schaefer [this message]
2006-10-09 22:23   ` Stanislaw Halik
2006-10-10 15:47     ` Bart Schaefer
2006-10-10 16:26       ` Stanislaw Halik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=061009080116.ZM6500@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).