From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29899 invoked from network); 24 Jun 2007 11:57:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 24 Jun 2007 11:57:43 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 2850 invoked from network); 24 Jun 2007 11:57:37 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 24 Jun 2007 11:57:37 -0000 Received: (qmail 15944 invoked by alias); 24 Jun 2007 11:57:33 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23592 Received: (qmail 15932 invoked from network); 24 Jun 2007 11:57:32 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 24 Jun 2007 11:57:32 -0000 Received: (qmail 2566 invoked from network); 24 Jun 2007 11:57:32 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 24 Jun 2007 11:57:29 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id 979EC5C3C6; Sun, 24 Jun 2007 07:57:27 -0400 (EDT) Date: Sun, 24 Jun 2007 07:57:27 -0400 From: Clint Adams To: Pierre Habouzit , 430146@bugs.debian.org Cc: zsh-workers@sunsite.dk Subject: Re: Bug#430146: zsh: please add .ssh/config Hosts to the hosts zstyle completion Message-ID: <20070624115727.GA31510@scowler.net> Mail-Followup-To: Pierre Habouzit , 430146@bugs.debian.org, zsh-workers@sunsite.dk References: <20070622180648.14337.68045.reportbug@localhost> <20070622211507.GA16349@scowler.net> <20070622222216.GA9656@artemis.internal.dc7.debconf.org> <20070623074721.GA28769@scowler.net> <20070623113320.GA25562@artemis.internal.dc7.debconf.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070623113320.GA25562@artemis.internal.dc7.debconf.org> User-Agent: Mutt/1.5.13 (2006-08-11) On Sat, Jun 23, 2007 at 12:33:21PM +0100, Pierre Habouzit wrote: > Anyways, I'm not using it anymore because I fancy the > .ssh/known_hosts more, but I miss it :) We could do something like this to generate matches from ~/.ssh/config . Anyone have better ideas? Index: Completion/Unix/Type/_hosts =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_hosts,v retrieving revision 1.10 diff -u -r1.10 _hosts --- Completion/Unix/Type/_hosts 5 Apr 2006 10:04:32 -0000 1.10 +++ Completion/Unix/Type/_hosts 24 Jun 2007 11:52:08 -0000 @@ -48,6 +48,11 @@ _cache_hosts+=($khosts) fi done + + if zstyle -t ":completion:${curcontext}:hosts" use-ssh-config; then + [[ -r ~/.ssh/config ]] && _cache_hosts+=(${=${${(M)${(f)"$(<~/.ssh/config)"}:#Host*}#Host }:#*\**}) + fi + fi _hosts=( "$_cache_hosts[@]" )