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

BUG: AUTO_CD is not respecting binaries in PATH



With AUTO_CD set and I enter a binary name that is available on my PATH but
there is a subdirectory of the same name, then zsh cds into that directory
when instead it should exectue the binary of the same name.

E.G.

[17:44]piers@laptop:~/projects
$ mkdir zsh
[17:45]piers@laptop:~/projects
$ zsh
[17:45]piers@laptop:~/projects/zsh
$ which zsh
/usr/bin/zsh
[17:45]piers@laptop:~/projects/zsh
$ echo $PATH
/home/piers/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

According to the docs this is not the correct behaviour, sine these are
commands that can be executed.

>If a command is issued that can't be executed as a normal command, and the
>command is the name of a directory, perform the cd command to that
directory.
>This option is only applicable if the option SHIN_STDIN is set, i.e. if
>commands are being read from standard input.  The option is designed for
>interactive use; it is recommended that cd be used explicitly in scripts to
>avoid ambiguity.


I'm running:

zsh 5.4.2 (x86_64-ubuntu-linux-gnu)

with kernel:

4.19.14-041914-generic


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