1
0
mirror of https://github.com/nvm-sh/nvm.git synced 2026-10-23 06:44:48 +08:00
Files
Jordan Harband b1b3a0038c [Fix] nvm_cd: bypass a user-defined cd function
`\cd` only bypasses aliases, so a user-defined `cd` function (eg, cdhist's) still ran,
and broke `NVM_DIR` auto-detection when it rejected zsh's `-q`.

Use `command cd`, which skips functions in POSIX shells.
zsh's `command` runs `/usr/bin/cd` instead of the builtin,
so use `builtin cd` there, as `nvm_echo` does for `printf`.
`nvm_die_on_prefix` also now uses `nvm_cd` instead of a bare `cd`.

Fixes #3835. See #3836.

Co-authored-by: Elan Ruusamäe <glen@delfi.ee>
2026-10-09 21:16:17 -07:00
..