From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2492 invoked from network); 5 Feb 2002 17:47:12 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 5 Feb 2002 17:47:12 -0000 Received: (qmail 18752 invoked by alias); 5 Feb 2002 17:47:07 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16566 Received: (qmail 18732 invoked from network); 5 Feb 2002 17:47:06 -0000 Date: Tue, 5 Feb 2002 12:47:02 -0500 From: Clint Adams To: Oliver Kiddle Cc: zsh-workers@sunsite.dk, david@debian.org Subject: Re: PATCH: _ssh (scp) Message-ID: <20020205174702.GA2325@dman.com> References: <20020204175927.GA12977@dman.com> <20020205102420.39912.qmail@web9304.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020205102420.39912.qmail@web9304.mail.yahoo.com> User-Agent: Mutt/1.3.25i > It would be more consistent with normal file completion to add the > files and directories together with the same tag and description. > I'd also be tempted to setup separate display strings so that the * for > executables, @ for symlinks etc are preserved in the file list. This does that somewhat messily. I intend to revert the bit where it checks PREFIX and in all cases have it do an ls on the dirname. However, I can't decide if it is better to ls -a1F /dir (thereby getting all the dotfiles and potentially respecting the local setting of GLOB_DOTS) or ls -d1F /dir/* (thereby respecting the remote setting of GLOB_DOTS or equivalent) Index: Completion/Unix/Command/_ssh =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_ssh,v retrieving revision 1.7 diff -u -r1.7 _ssh --- Completion/Unix/Command/_ssh 2002/02/04 18:44:23 1.7 +++ Completion/Unix/Command/_ssh 2002/02/05 17:35:42 @@ -1,18 +1,26 @@ #compdef ssh slogin=ssh scp ssh-add ssh-agent ssh-keygen _remote_files () { - # Rather than simple directory discrimination, there should be - # coloring based on all the different ls -F classifiers. - local expl remfiles + # There should be coloring based on all the different ls -F classifiers. + local expl remfiles remdispf remdispd if zstyle -T ":completion:${curcontext}:" remote-access; then - remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -d1F ${words[CURRENT]#*:}\* 2>/dev/null)"}) + if [[ $options[globdots] == "on" ]] && [[ "$PREFIX" == */ || -z "$PREFIX" ]]; + then + print ssh -a -x ${words[CURRENT]%:*} ls -a1F ${words[CURRENT]#*:} + remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -a1F ${words[CURRENT]#*:} 2>/dev/null)"}) + else + remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -d1F ${words[CURRENT]#*:}\* 2>/dev/null)"}) + fi - _wanted files expl 'remote files' \ - compadd ${${remfiles:#*/}/[*=@|](#e)/} + remdispf=(${remfiles:#*/}) + remdispd=(${(M)remfiles:#*/}) - _wanted dirs expl 'remote directories' \ - compadd -S/ ${${(M)remfiles:#*/}/\\/(#e)/} + _wanted files expl 'remote files and directories' \ + compadd -d remdispf ${${remfiles:#*/}/[*=@|](#e)/} + + _wanted files expl 'remote files and directories' \ + compadd -S/ -d remdispd ${${(M)remfiles:#*/}/\\/(#e)/} else _message 'remote files' fi