1 Commits
Author SHA1 Message Date
Gregory Myers a4fadf1eae [readme] zsh load-nvmrc: skip during tab completion
When completing a path containing `../` for `cd`, `pushd`, or `chdir`,
zsh's `_cd` runs `$(cd ${PREFIX%/*} ...)`,
which fires the `chpwd` hook in a subshell,
so `load-nvmrc` ran on each such completion, slowly in large directories.

`compstate` is set only inside completion widgets.
Checking `ZSH_SUBSHELL` instead would also skip deliberate subshells, like `( cd proj && npm test )`,
and checking it along with `WIDGET` would skip any widget's subshell, not just completion's.

Fixes #3606
2026-11-05 11:04:35 +00:00