Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
trying directories in path one by one
- X-seq: zsh-workers 55241
- From: Mandar Mitra <mandar.mitra@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: trying directories in path one by one
- Date: Wed, 4 Nov 2026 18:52:05 +0530
- Archived-at: <https://zsh.org/workers/55241>
- List-id: <zsh-workers.zsh.org>
Hello,
If I have a command that is available in multiple directories in PATH, zsh's behaviour suggests that it tries them in turn until one succeeds. Is there an option / environment variable / similar that I can use to turn this off?
For example, pip could be available from both a virtualenv and the system location (/bin). If the virtualenv pip fails, I'd like to know right away, without the stderr messages getting lost in the voluminous output from /bin/pip.
I looked in the FAQ and man zshoptions, and didn't find a direct answer to this question (HASH_CMDS seemed tangentally related, though). I also asked Claude, which pointed me to Src/exec.c in the zsh source, but said it didn't know of a zsh option that disables the fallthrough.
Many thanks for any pointers, suggestions, etc.
Mandar.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author