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

Re: Directory-only `cd' completion via compctl bug



On Mar 20 at 17:26, Andrej Borsenkow wrote:
,--
| > # 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/
|
| Just tried with zsg-3.1.2-zefram3 (+some patches) and it works quite fine.
| I am using the same completion. Which zsh version do you have? Try to
| start with vanilla zsh -f (may be, some options you set cause it).
`--
Nope, I still can't get it to work correctly.

gizmo:~> zsh-3.1.2-zefram3/Src/zsh -f
gizmo% echo $ZSH_VERSION
3.1.2-zefram3

I then pasted in the above `cd' compctl defintion, and pasted in the
`cdmatch' function. Exact same bahavior:

gizmo% cd T<tab>
Test\\\ -\\\ abc     Test\\\ -\\\ ghi
Test\\\ -\\\ def     Trouble\\\ -\\\ abc
gizmo% cd Tr<tab> -> cd Trouble\\\ -\\\ abc/
cd: no such file or directory: Trouble\ -\ abc/
gizmo% cd ./Tr<tab> -> cd ./Trouble\ -\ abc/

My 3.1.2-zefram3 has patches 3713, 3714 and 3739 applied. But I get the
same behavior described above under zsh-3.0.2 as well.



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