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

Re: [bug] escaping spaces in _canonical_paths

On Mar 10,  5:53am, Daniel Shahaf wrote:
} Perhaps the abspath branch gets confused on mountpoint names that
} contain literal ' characters?  Since the ${foo/bar/baz} replacement is
} done on the compadd results, and compadd wasn't called with -Q.

Indeed, I created a mount point named "aa'cc 2" and with the patch
from 40801, _canonical_paths is not able to complete that as an
absolute path if given a prefix.

It will correctly add the absolute path to the menu of completions if
there is no path prefix.

On a quick test the absolute-path case needs $PREFIX as-is, whereas
the local-directory case needs ${(Q)PREFIX}.

There's yet a third case -- a relative sub-directory, e.g.

% cd /
% sudo umount <TAB>

will show mnt/aa\'cc\ 2 in the list of completions, but

% sudo umount mnt<TAB>

will not complete anything, whereas both

% sudo umount /mnt/a<TAB>


% cd mnt
% sudo umount a<TAB>

correctly show a result.

There may be a bug with the :P modifier -- see other thread.  With that
fixed, things are better, but still messed up when $compstate[quote] is
a substring of the mount point name (if you see what I mean).

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