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

Directory-only `cd' completion via compctl bug



I'm using the cd completion routines from the "example" compctl file
provided with the zsh distribution:

# Another possibility for cd/pushd is to use it in conjunction with the
# cdmatch function (in the Functions subdirectory of zsh distribution).

if [[ -o AUTO_REMOVE_SLASH ]] then
    compctl -x 'p[2]' -Q -K cdmatch2 - 'S[/][~][./][../]' -g '*(-/)' + \
        -g '*(-/D)' - 'n[-1,/], s[]' -K cdmatch -q -S '/' -- cd pushd
else
    compctl -x 'p[2]' -Q -K cdmatch2 - 'S[/][~][./][../]' -g '*(-/)' + \
        -g '*(-/D)' - 'n[-1,/], s[]' -K cdmatch -S '/' -- cd pushd
fi

This works great... except for one case that I've found so far.

If you try to CD into a directory with spaces in the name, for some
reason it escapes the backslashes:

cd Schoolhouse\\\ Rock\\\ -\\\ America\\\ Rock/

instead of

cd Schoolhouse\ Rock\ -\ America\ Rock/

Any ideas how to fix it? (Note that is doesn't do it if there is a leading
slash, i.e., `cd ./Sc[tab]' works fine but `cd Sc[tab]' does not.)

Eddy



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