From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6431 invoked from network); 13 Feb 2003 14:39:35 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 13 Feb 2003 14:39:35 -0000 Received: (qmail 25951 invoked by alias); 13 Feb 2003 14:38:38 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5915 Received: (qmail 25939 invoked from network); 13 Feb 2003 14:38:38 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 13 Feb 2003 14:38:38 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.147] by sunsite.dk (MessageWall 1.0.8) with SMTP; 13 Feb 2003 14:38:37 -0000 X-VirusChecked: Checked X-Env-Sender: kiddleo@logica.com X-Msg-Ref: server-10.tower-27.messagelabs.com!1045146938!2730 Received: (qmail 15204 invoked from network); 13 Feb 2003 14:35:38 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-10.tower-27.messagelabs.com with SMTP; 13 Feb 2003 14:35:38 -0000 Received: from finches.logica.co.uk ([158.234.142.11]) by iris.logica.co.uk (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id OAA14186; Thu, 13 Feb 2003 14:38:35 GMT X-Authentication-Warning: iris.logica.co.uk: Host [158.234.142.11] claimed to be finches.logica.co.uk Received: from finches.logica.co.uk (localhost [127.0.0.1]) by finches.logica.co.uk (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h1DEfiU29393; Thu, 13 Feb 2003 15:41:45 +0100 In-reply-to: <87d6lwqper.fsf@lynx.ionific.com> From: Oliver Kiddle References: <87d6lwqper.fsf@lynx.ionific.com> To: Hannu Koivisto cc: zsh-users@sunsite.dk Subject: Re: Remote scp completion that can handle spaces etc. in pathnames Date: Thu, 13 Feb 2003 15:41:44 +0100 Message-ID: <29391.1045147304@finches.logica.co.uk> Sender: kiddleo@logica.com On 13 Feb, you wrote: > > Let's say that there is a directory "foo bar" on host baz. If I > try to copy it recursively with scp from baz to the current host, I > have to say ``scp -r baz:foo\\\ bar .'' That is, I need to > "double quote". However, if I use zsh's completion to get me that > directory, i.e. I write ``scp -r baz:fo'', I get > ``scp -r baz:foo\ bar/'', which does not work. > > I use openssh 3.4p1 and zsh 4.0.4 on Debian GNU/Linux woody. Is > this handled differently in a later (stable or development) version > and/or would this be easy to fix locally? 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. > 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. 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 compadd ${suf:+-S/} "$@" "$expl[@]" -d remdispd \ - ${remdispd%/} && ret=0 + ${(q)remdispd%/} && ret=0 done (( ret )) || return 0 done This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.