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

cd completion does not work in CVS version (unsafe word splitting in _alternative).



With fresh CVS ... (actually, it was the reason I fetched CVS - it did not work
in patched pws-12 as well) cd into $cdpath does not work. I tracked it down to:

+_alternative:62> action=( _path_files -W \(/home/bor /home/bor/src /tools/src
/archive/sni/dbase\) -/ )
+_alternative:63> _path_files -J -default- -W (/home/bor /home/bor/src
/tools/src/archive/sni/dbase) -/
+

The relevant lines in _alternative are:

        action=( $=action )
        ${(e)action[1]} "$subopts[@]" "$expl[@]" "${(@e)~action[2,-1]}"

In other words, _every_ action with SP in argument is doomed because it is
splitted in multiple arguments. This is a general problem.

In case of _cd this results from:

    _alternative \
        'local-directories:local directories:_path_files -/' \
        "path-directories: directories in cdpath:_path_files -W
\\(${${(@)cdpath:#.}}\\) -/"

I don't see, why should we exclude `.'. If it is in cdpath and user requested
path-directories - why not?

/andrej



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