From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5740 invoked from network); 4 Feb 2002 18:43:29 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 4 Feb 2002 18:43:29 -0000 Received: (qmail 1577 invoked by alias); 4 Feb 2002 18:43:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16555 Received: (qmail 1566 invoked from network); 4 Feb 2002 18:43:19 -0000 Date: Mon, 4 Feb 2002 13:43:15 -0500 From: Clint Adams To: Bart Schaefer Cc: zsh-workers@sunsite.dk, david@debian.org Subject: Re: PATCH: _ssh (scp) Message-ID: <20020204184315.GA14218@dman.com> References: <20020204175927.GA12977@dman.com> <1020204182501.ZM21407@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1020204182501.ZM21407@candle.brasslantern.com> User-Agent: Mutt/1.3.25i > This still needs the 2>/dev/null fix I described in 16533. Right. Patch below. Also adds | to the bracket expression. We still need a solution to the zle redisplay problem. > If you *are* going to parse "ls -F" output, you should remove the comment > that indicates otherwise. Well, it's not doing colorings, but I'll modify the comment. > Another possible approach would be to use ls (without -d) on the directory > parent of the remote path, and let the completion system filter out the > non-matching names, rather than the rather crude hack I did of appending > a `*' to the path. This would support complete-in-word a bit better, but > means more network traffic. That should probably be configurable via an adjunct to the remote-access style then. Index: Completion/Unix/Command/_ssh =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_ssh,v retrieving revision 1.6 diff -u -r1.6 _ssh --- Completion/Unix/Command/_ssh 2002/02/04 18:03:25 1.6 +++ Completion/Unix/Command/_ssh 2002/02/04 18:40:48 @@ -1,15 +1,15 @@ #compdef ssh slogin=ssh scp ssh-add ssh-agent ssh-keygen _remote_files () { - # This is extremely simple-minded; could parse "ls -F" output to do - # colorings and LIST_TYPES and so on, but I'm just not that ambitious. + # Rather than simple directory discrimination, there should be + # coloring based on all the different ls -F classifiers. local expl remfiles if zstyle -T ":completion:${curcontext}:" remote-access; then - remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -d1F ${words[CURRENT]#*:}\*)"}) + remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -d1F ${words[CURRENT]#*:}\* 2>/dev/null)"}) _wanted files expl 'remote files' \ - compadd ${${remfiles:#*/}/[*=@](#e)/} + compadd ${${remfiles:#*/}/[*=@|](#e)/} _wanted dirs expl 'remote directories' \ compadd -S/ ${${(M)remfiles:#*/}/\\/(#e)/}