From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6697 invoked from network); 13 Feb 2003 15:06:48 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 13 Feb 2003 15:06:48 -0000 Received: (qmail 9556 invoked by alias); 13 Feb 2003 15:06:15 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5917 Received: (qmail 9548 invoked from network); 13 Feb 2003 15:06:14 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 13 Feb 2003 15:06:14 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [195.197.252.71] by sunsite.dk (MessageWall 1.0.8) with SMTP; 13 Feb 2003 15:6:13 -0000 Received: from azure by lynx.ionific.com with local (Exim 3.35 #1 (Debian)) id 18jKwI-0004cn-00; Thu, 13 Feb 2003 17:06:14 +0200 To: Oliver Kiddle Cc: zsh-users@sunsite.dk Subject: Re: Remote scp completion that can handle spaces etc. in pathnames Mail-copies-to: nobody From: Hannu Koivisto Date: Thu, 13 Feb 2003 17:06:14 +0200 In-Reply-To: <29391.1045147304@finches.logica.co.uk> (Oliver Kiddle's message of "Thu, 13 Feb 2003 15:41:44 +0100") Message-ID: <87heb8p6e1.fsf@lynx.ionific.com> User-Agent: Gnus/5.090014 (Oort Gnus v0.14) Emacs/21.2 (i386-debian-linux-gnu) References: <87d6lwqper.fsf@lynx.ionific.com> <29391.1045147304@finches.logica.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: Hannu Koivisto Oliver Kiddle writes: > Patch below should fix this. _ssh has changed a bit since 4.0.4 so I'm > not sure how easy it would be to modify for that. Thanks! It applied to 4.0.4 just fine. However, I needed an additional modification to make it work with filenames such as ``[foo bar* |'' -- * and | didn't appear at all without this modification. I wonder if this breaks something elsewhere? See the modification below, within your patch. >> I also note that pathnames in remote commands are not completed >> remotely, i.e. if I write ``ssh somehost ls f'', zsh completes >> local filesystem entries beginning with f. I wonder if this could >> be smarter as well. > > It could possibly be done by somehow doing a temporary substitution of > _path_files by _remote_files but saving the original _path_files and > doing any other necessary fiddling would be more than a bit messy so I'm > not going to attempt it. Ok, I can certainly live without such a feature. > Oliver > > Index: Completion/Unix/Command/_ssh > =================================================================== > RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_ssh,v > retrieving revision 1.18 > diff -u -r1.18 _ssh > --- Completion/Unix/Command/_ssh 7 Jan 2003 08:49:16 -0000 1.18 > +++ Completion/Unix/Command/_ssh 13 Feb 2003 14:29:21 -0000 > @@ -17,9 +17,9 @@ > while _tags; do > while _next_label files expl ${suf:-remote directory}; do > [[ -n $suf ]] && compadd "$@" "$expl[@]" -d remdispf \ > - ${remdispf%[*=@|]} && ret=0 > + ${(q)remdispf%[*=@|]} && ret=0 I replaced the above line with this: + ${(q)remdispf%[=@]} && ret=0 > compadd ${suf:+-S/} "$@" "$expl[@]" -d remdispd \ > - ${remdispd%/} && ret=0 > + ${(q)remdispd%/} && ret=0 > done > (( ret )) || return 0 > done -- Hannu