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

Re: Zsh autocompletion with no access to a parent directory



On Fri, 23 Apr 2010 08:01:53 -0700
Matt Wright <matt@xxxxxxxxxxxx> wrote:
> If you have a path with a "special" character in it, where by special
> so far I've found space and tilde, then completion stops offering
> results after that letter. It's particularly frustrating on a Mac, where
> many app bundles have spaces in their names but the actual executables
> are another two layers of directories deeper after the bundle name.

It appears to be this, though I haven't looked too closely since I've
heard it makes you blind.  Where is the input supposed to be unquoted?
Er... 

Index: Completion/Unix/Type/_path_files
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_path_files,v
retrieving revision 1.50
diff -p -u -r1.50 _path_files
--- Completion/Unix/Type/_path_files	14 Apr 2010 09:57:47 -0000	1.50
+++ Completion/Unix/Type/_path_files	23 Apr 2010 21:43:14 -0000
@@ -363,8 +363,8 @@ for prepath in "$prepaths[@]"; do
     # path prefix first: in the first case, this saves stats in the simple
     # case and may get around automount behaviour if early components don't
     # yet exist, and in the second case this is the prefix we want to keep.
-    tmp1=$match[1]
-    tpre=$match[2]
+    tmp1=${(Q)match[1]}
+    tpre=${(Q)match[2]}
     while true; do
       if [[ -z $path_completion || -d $prepath$realpath$donepath$tmp1 ]]; then
 	donepath=$donepath$tmp1/


-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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