'main': Work around a zsh bug reported to us as #606.

As of this writing, it seems that the 'type' builtin poisons the commands hash
in a way that breaks AUTO_CD to absolute paths that don't end with a slash.
This commit is contained in:
Daniel Shahaf 2019-03-16 07:34:12 +00:00
parent d61ebbcbbf
commit 37d6108215

View file

@ -180,7 +180,7 @@ _zsh_highlight_main__type() {
# #
# The first disjunct mimics the isrelative() C call from the zsh bug. # The first disjunct mimics the isrelative() C call from the zsh bug.
elif { [[ $1 != */* ]] || is-at-least 5.3 } && elif { [[ $1 != */* ]] || is-at-least 5.3 } &&
! builtin type -w -- $1 >/dev/null 2>&1; then ! (builtin type -w -- $1) >/dev/null 2>&1; then
REPLY=none REPLY=none
fi fi
fi fi