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

Re: Directory completion acts as if CHASE_LINKS is set

On 06/09/13 03:31, Bart Schaefer wrote:
In any case, this is a problem inherent in the way globbing interprets
"../" -- filename generation does not obey the same rules as "cd" path

torch% print ../*(/)
../bar ../foo
torch% print $PWD:h/*(/)

Completion uses globbing to generate the target file names, so this has
to be fixed up somehow in _cd before _path_files is called.

This patch is a step in the right direction, but has the side-effect of
expanding ".." into $PWD:h which is probably not desirable.  There may
be other nuances [particularly with completion in the middle of a word]
that are not handled.  So I'm not going to commit it, just presenting it
for purposes of discussion.

Thanks, that patch does solve the issue with cd to a certain degree. But as you said yourself it is not specific to cd – for example, 'ls ../[TAB]' has the same problem. So I assume that patching the individual command completions is not the best way to go about it, but I'm not familiar enough with the zsh internals to know what the right way would be.


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