'main': Prevent an infinite loop when $PWD had been deleted

Fixes #819
This commit is contained in:
Daniel Shahaf
2026-10-09 17:16:49 +00:00
parent 0bfcb582e7
commit e6683f20e5
+6 -1
View File
@@ -1240,9 +1240,14 @@ _zsh_highlight_main_highlighter_check_path()
fi fi
tmp_path=$tmp_path:a tmp_path=$tmp_path:a
local candidate_new_tmp_path
while [[ $tmp_path != / ]]; do while [[ $tmp_path != / ]]; do
[[ -n ${(M)ZSH_HIGHLIGHT_DIRS_BLACKLIST:#$tmp_path} ]] && return 1 [[ -n ${(M)ZSH_HIGHLIGHT_DIRS_BLACKLIST:#$tmp_path} ]] && return 1
tmp_path=$tmp_path:h candidate_new_tmp_path=${tmp_path:h}
if [[ $candidate_new_tmp_path == $tmp_path ]]; then
break
fi
tmp_path=${candidate_new_tmp_path}
done done
if (( in_command_position )); then if (( in_command_position )); then