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

Re: ZSH - tab-completion of $PATH won't work with /./ or /../ in it



On Tue, Dec 8, 2015 at 9:24 PM, John Polansky <johnpolansky@xxxxxxxxx> wrote:
>
> While I realize it's unusual to have . or .. in a path.. it can happen
> through scripting and to me this seems like a bug which should be fixed.

As is often the case, this is not as obvious as it may appear.

Command completion uses the command hash table.  Commands that appear
in the hash table are, pretty much by definition, the commands that
are completed.  There is no actual path search during completion, just
a hash table lookup.

The command hash table has NEVER included commands that appear along
any relative path.

So the behavior you are describing is technically not a bug; it's
standard zsh behavior for the last 20 or so years.



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