From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6852 invoked from network); 9 Oct 2006 15:02:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.6 (2006-10-03) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.6 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 9 Oct 2006 15:02:41 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 64191 invoked from network); 9 Oct 2006 15:02:34 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 9 Oct 2006 15:02:34 -0000 Received: (qmail 7751 invoked by alias); 9 Oct 2006 15:02:24 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10816 Received: (qmail 7740 invoked from network); 9 Oct 2006 15:02:22 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 9 Oct 2006 15:02:22 -0000 Received: (qmail 63016 invoked from network); 9 Oct 2006 15:02:22 -0000 Received: from vms046pub.verizon.net (206.46.252.46) by a.mx.sunsite.dk with SMTP; 9 Oct 2006 15:02:17 -0000 Received: from torch.brasslantern.com ([71.116.118.106]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0J6V00FYSJ26PC57@vms046.mailsrvcs.net> for zsh-users@sunsite.dk; Mon, 09 Oct 2006 10:01:19 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id k99F1HOe006502 for ; Mon, 09 Oct 2006 08:01:17 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id k99F1Gv6006501 for zsh-users@sunsite.dk; Mon, 09 Oct 2006 08:01:16 -0700 Date: Mon, 09 Oct 2006 08:01:16 -0700 From: Bart Schaefer Subject: Re: problems with ssh tab completion In-reply-to: <20061009023729.GA6361@localhost.localdomain> To: zsh-users@sunsite.dk Message-id: <061009080116.ZM6500@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20061009023729.GA6361@localhost.localdomain> Comments: In reply to Stanislaw Halik "problems with ssh tab completion" (Oct 9, 4:37am) 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.