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

[ejb@xxxxxx: Bug#243385: zsh: rsync completion expands * too soon]



I assume that this is a quoting issue again.

----- Forwarded message from Jay Berkenbilt <ejb@xxxxxx> -----

Date: Mon, 12 Apr 2004 15:59:30 -0400
From: Jay Berkenbilt <ejb@xxxxxx>
To: Debian Bug Tracking System <submit@xxxxxxxxxxxxxxx>
Subject: Bug#243385: zsh: rsync completion expands * too soon

Package: zsh
Version: 4.1.1-14
Severity: normal
Tags: patch

(Unless zsh-workers has been reconfigured since my last bug report,
the X-Debbugs-CC to zsh-workers will fail and this bug will not have
been reported upstream.)

This is essentially identical to what I reported in Debian bug 239070
for scp: the same bug existed with rsync's completion function.  The
attached patch removes "_call_program files" from the ssh line used to
generate remote files and also adds the -L flag to ls, just like my
earlier patch to _ssh.  I have dispensed with a lengthy explanation
because it is essentially identical to the one I included in bug
239070, the fix to which appears to have been accepted upstream.

This patch is to /usr/share/zsh/4.1.1/functions/Completion/Unix/_rsync.

-------8<--------
--- _rsync~	2004-03-25 13:29:33.000000000 -0500
+++ _rsync	2004-04-09 18:14:08.000000000 -0400
@@ -37,7 +37,7 @@
 
   if zstyle -T ":completion:${curcontext}:" remote-access; then
     slash=/
-    remfiles=(${(f)"$(_call_program files ssh -a -x ${words[CURRENT]%:*} ls -d1F ${${${words[CURRENT
+    remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -d1FL ${${${words[CURRENT
 ]#*:}:h}/${slash}(#e)/}/\* 2>/dev/null)"})
 
     remdispf=(${remfiles:#*/})
-------8<--------

This patch causes rsync completion to work properly for remote files
when you have ssh access to the remote system.  It still doesn't
behave quite as well as scp completion (rsync host:/path/ TAB doesn't
show alternatives unless you type at least one character after the /),
but at least it behaves as well as it did before the _call_program
function call was added.

A grep for '_call_program files ssh' suggests that this may be the
only place left that has this particular bug.  Too bad I didn't think
to do that last time. :-)

Please let me know if additional information is required or if I
should have repeated the information to substantiate this patch.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.4.25-1-686-smp
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8

Versions of packages zsh depends on:
ii  debconf                     1.4.16       Debian configuration management sy
ii  libc6                       2.3.2.ds1-11 GNU C Library: Shared libraries an
ii  libcap1                     1:1.10-13    support for getting/setting POSIX.
ii  libncurses5                 5.4-2        Shared libraries for terminal hand
ii  passwd                      1:4.0.3-21   Change and administer password and

-- debconf information:
  zsh/rcmove: 

--- _rsync~	2004-03-25 13:29:33.000000000 -0500
+++ _rsync	2004-04-09 18:14:08.000000000 -0400
@@ -37,7 +37,7 @@
 
   if zstyle -T ":completion:${curcontext}:" remote-access; then
     slash=/
-    remfiles=(${(f)"$(_call_program files ssh -a -x ${words[CURRENT]%:*} ls -d1F ${${${words[CURRENT
+    remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -d1FL ${${${words[CURRENT
 ]#*:}:h}/${slash}(#e)/}/\* 2>/dev/null)"})
 
     remdispf=(${remfiles:#*/})


----- End forwarded message -----



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