zsh-workers
 help / color / mirror / code / Atom feed
* zsh-4.2.0-pre-4: problems with _remote_files
@ 2004-03-19 15:07 Alexey Tourbin
  2004-03-25 10:28 ` Alexey Tourbin
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Tourbin @ 2004-03-19 15:07 UTC (permalink / raw)
  To: zsh-workers; +Cc: Alexey Voinov

[-- Attachment #1: Type: text/plain, Size: 1663 bytes --]

Hi!

I've been testing zsh-4.2.0-pre-4 for a while, along with Alexey Voinov.
We've noticed a few problems with _remote_files completion (ssh).

First, Alexey Voinov reports a problem (that I can't reproduce):

$ scp localhost:s<tab>
No matches for: `file' or `remote file'
$ scp altair:<tab>
remote file
RPM@      archive/  tmp/
$

I.e. it says "no matches" or "remote file" (which is not expected), and
the file list is incomplete.

Second, I've noticed that quoting is broken inside _remote_files:

$ cd
$ scp localhost:t<TAB>
tmp/
$ touch \'
$ scp localhost:t<TAB>
<BEEP>
$ rm -f \'
$ scp localhost:t<TAB>
tmp/
$

I believe there were no such problems with zsh-4.1.1.
So I am about to blame the following chunk.
Can't you explain, please?
And thanks,

-- 
Alexey Tourbin
ALT Linux Team


--- zsh-4.1.1/Completion/Unix/Command/_ssh	2003-05-15 09:25:21 +0000
+++ zsh-4.2.0-pre-4/Completion/Unix/Command/_ssh	2004-02-24 13:00:50 +0000
@@ -4,9 +4,9 @@ _remote_files () {
   # There should be coloring based on all the different ls -F classifiers.
   local expl remfiles remdispf remdispd args suf ret=1
 
-  if zstyle -T ":completion:${curcontext}:" remote-access; then
+  if zstyle -T ":completion:${curcontext}:files" remote-access; then
     zparseopts -D -E -a args p: 1 2 4 6 F:
-    remfiles=(${(M)${(f)"$(ssh $args -a -x ${IPREFIX%:} ls -d1F ${(Q)PREFIX%%[^./][^/]#}\* 2>/dev/null)"}%%[^/]#(|/)})
+    remfiles=(${(M)${(f)"$(_call_program files ssh $args -a -x ${IPREFIX%:} ls -d1F ${(Q)PREFIX%%[^./][^/]#}\* 2>/dev/null)"}%%[^/]#(|/)})
     compset -P '*/'
     compset -S '/*' || suf='remote file'
 

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: zsh-4.2.0-pre-4: problems with _remote_files
  2004-03-19 15:07 zsh-4.2.0-pre-4: problems with _remote_files Alexey Tourbin
@ 2004-03-25 10:28 ` Alexey Tourbin
  2004-03-25 16:58   ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Tourbin @ 2004-03-25 10:28 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1427 bytes --]

On Fri, Mar 19, 2004 at 06:07:22PM +0300, Alexey Tourbin wrote:
> I've been testing zsh-4.2.0-pre-4 for a while, along with Alexey Voinov.
> We've noticed a few problems with _remote_files completion (ssh).

I've tracked down the problem: using _call_program requires extra
quoting because of additional level of indirection inside eval "$argv".

Here is what happens when _remote_files is invoked.

$ touch \'
$ ssh -a -x localhost ls -d1F \*
<file list> -- works fine

$ _call_program files ssh -a -x localhost ls -d1F \*
zsh: unmatched '

You see, the same command wrapped into _call_program doesn't work.
And what it should be:

$ _call_program files ssh -a -x localhost ls -d1F \\\*
<file list> -- now works

The following patch solves the problem.

--- zsh-4.2.0/Completion/Unix/Command/_ssh-	2004-02-24 13:00:50 +0000
+++ zsh-4.2.0/Completion/Unix/Command/_ssh	2004-03-24 19:55:58 +0000
@@ -6,7 +6,7 @@ _remote_files () {
 
   if zstyle -T ":completion:${curcontext}:files" remote-access; then
     zparseopts -D -E -a args p: 1 2 4 6 F:
-    remfiles=(${(M)${(f)"$(_call_program files ssh $args -a -x ${IPREFIX%:} ls -d1F ${(Q)PREFIX%%[^./][^/]#}\* 2>/dev/null)"}%%[^/]#(|/)})
+    remfiles=(${(M)${(f)"$(_call_program files ssh $args -a -x ${IPREFIX%:} ls -d1F ${(Q)PREFIX%%[^./][^/]#}\\\* 2>/dev/null)"}%%[^/]#(|/)})
     compset -P '*/'
     compset -S '/*' || suf='remote file'
 

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: zsh-4.2.0-pre-4: problems with _remote_files
  2004-03-25 10:28 ` Alexey Tourbin
@ 2004-03-25 16:58   ` Bart Schaefer
  2004-03-25 20:14     ` Alexey Tourbin
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2004-03-25 16:58 UTC (permalink / raw)
  To: Alexey Tourbin, zsh-workers

On Mar 25,  1:28pm, Alexey Tourbin wrote:
}
} I've tracked down the problem: using _call_program requires extra
} quoting because of additional level of indirection inside eval "$argv".

This was already discussed in zsh-workers/19666,19668 and surrounding
thread, and a patch has already been committed to CVS on sourceforge.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: zsh-4.2.0-pre-4: problems with _remote_files
  2004-03-25 16:58   ` Bart Schaefer
@ 2004-03-25 20:14     ` Alexey Tourbin
  0 siblings, 0 replies; 4+ messages in thread
From: Alexey Tourbin @ 2004-03-25 20:14 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 452 bytes --]

On Thu, Mar 25, 2004 at 04:58:14PM +0000, Bart Schaefer wrote:
> } I've tracked down the problem: using _call_program requires extra
> } quoting because of additional level of indirection inside eval "$argv".
> 
> This was already discussed in zsh-workers/19666,19668 and surrounding
> thread, and a patch has already been committed to CVS on sourceforge.

Oops, my zsh-workers@sunsite subscription seems to be broken. :(
Thanks a lot anyway.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-03-25 20:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-19 15:07 zsh-4.2.0-pre-4: problems with _remote_files Alexey Tourbin
2004-03-25 10:28 ` Alexey Tourbin
2004-03-25 16:58   ` Bart Schaefer
2004-03-25 20:14     ` Alexey Tourbin

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).