Files
easyzsh/zsh/pyenv.zsh
T
Yuhao Qing d5afd25bbe perf(pyenv): initialize shell integration once without rehash
Login shells source the fragment twice to restore shim precedence after the system profile. Reapplying PATH does not require repeating shell integration or rebuilding shims.
2026-09-08 00:41:08 +08:00

11 lines
568 B
Bash

# pyenv (Python Version Manager), always-on via ~/.zshenv
export PYENV_ROOT="${PYENV_ROOT:-$HOME/.pyenv}"
[[ -d "$PYENV_ROOT/bin" ]] && path=("$PYENV_ROOT/bin" ${path:#$PYENV_ROOT/bin})
[[ -d "$PYENV_ROOT/shims" ]] && path=("$PYENV_ROOT/shims" ${path:#$PYENV_ROOT/shims})
export PATH
# Login profiles can reapply PATH without repeating shell integration.
# Run `pyenv rehash` after installing entry points through `python -m pip`.
if [[ -o interactive ]] && (( ! $+functions[pyenv] )) && command -v pyenv &> /dev/null; then
eval "$(pyenv init - --no-rehash zsh)"
fi