Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zsh-4.2.0-pre-4: problems with _remote_files



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: pgpUJ6414BJ1m.pgp
Description: PGP signature



Messages sorted by: Reverse Date, Date, Thread, Author