zsh-users
 help / color / mirror / code / Atom feed
* Directory-only `cd' completion via compctl bug
@ 1998-03-19 19:44 Eddy J. Gurney
  1998-03-20 14:26 ` Andrej Borsenkow
  0 siblings, 1 reply; 3+ messages in thread
From: Eddy J. Gurney @ 1998-03-19 19:44 UTC (permalink / raw)
  To: zsh-users

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


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

end of thread, other threads:[~1998-03-24 16:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-19 19:44 Directory-only `cd' completion via compctl bug Eddy J. Gurney
1998-03-20 14:26 ` Andrej Borsenkow
1998-03-24 16:34   ` Eddy J. Gurney

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