zsh-workers
 help / color / mirror / code / Atom feed
* [glisse@stedding.loria.fr: Bug#307341: zsh: insufficient escaping of spaces in _ssh completion]
@ 2005-05-02 17:10 Clint Adams
  2005-05-07 17:13 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 2005-05-02 17:10 UTC (permalink / raw)
  To: zsh-workers; +Cc: 307341-forwarded

----- Forwarded message from Marc Glisse <glisse@stedding.loria.fr> -----

Assume there is a directory '/data/a a' on host somehost. When I type:
scp somehost:/data/a<TAB>
it gets completed to:
scp somehost:/data/a\\\ a/
But when I press <TAB> again, it fails, as if directory 'a a' did not
exist. I tried manually modifying the line to:
scp somehost:/data/a\\\\\ a/
and then completion works again (another extra pair of '\' still makes it
work), but the command itself does not work anymore.

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


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

* Re: [glisse@stedding.loria.fr: Bug#307341: zsh: insufficient escaping of spaces in _ssh completion]
  2005-05-02 17:10 [glisse@stedding.loria.fr: Bug#307341: zsh: insufficient escaping of spaces in _ssh completion] Clint Adams
@ 2005-05-07 17:13 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2005-05-07 17:13 UTC (permalink / raw)
  To: zsh-workers; +Cc: 307341-forwarded

On May 2,  1:10pm, Clint Adams wrote:
} Subject: [glisse@stedding.loria.fr: Bug#307341: zsh: insufficient escaping
}
} ----- Forwarded message from Marc Glisse <glisse@stedding.loria.fr> -----
} 
} scp somehost:/data/a<TAB>
} scp somehost:/data/a\\\ a/
} But when I press <TAB> again, it fails, as if directory 'a a' did not
} exist. 
} 
} ----- End forwarded message -----

I think this deals with it.  Does anyone remember in what case we might
need (Q) applied to the prefix?  Some mixture of quoting forms, perhaps?

Index: Completion/Unix/Command/_ssh
===================================================================
diff -c -r1.14 _ssh
--- Completion/Unix/Command/_ssh	6 Dec 2004 16:51:17 -0000	1.14
+++ Completion/Unix/Command/_ssh	7 May 2005 17:08:15 -0000
@@ -2,11 +2,15 @@
 
 _remote_files () {
   # There should be coloring based on all the different ls -F classifiers.
-  local expl remfiles remdispf remdispd args suf ret=1
+  local expl rempat remfiles remdispf remdispd args suf ret=1
 
   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 -d1FL "${(Q)PREFIX%%[^./][^/]#}\*" 2>/dev/null)"}%%[^/]#(|/)})
+    if [[ -z $QIPREFIX ]]
+    then rempat="${PREFIX%%[^./][^/]#}\*"
+    else rempat="${(q)PREFIX%%[^./][^/]#}\*"
+    fi
+    remfiles=(${(M)${(f)"$(_call_program files ssh $args -a -x ${IPREFIX%:} ls -d1FL "$rempat" 2>/dev/null)"}%%[^/]#(|/)})
     compset -P '*/'
     compset -S '/*' || suf='remote file'
 


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

end of thread, other threads:[~2005-05-07 17:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-02 17:10 [glisse@stedding.loria.fr: Bug#307341: zsh: insufficient escaping of spaces in _ssh completion] Clint Adams
2005-05-07 17:13 ` Bart Schaefer

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).