From c77fa00f987c617e4027065027b912795bda57d2 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Sat, 21 Jun 2025 18:28:35 +0900 Subject: [PATCH] Fix pyenv --- init.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init.zsh b/init.zsh index e1ea806..0cfac17 100644 --- a/init.zsh +++ b/init.zsh @@ -305,6 +305,14 @@ if cmd_exists pyenv; then export PYENV_ROOT="${HOME}/.pyenv" [[ -d "${PYENV_ROOT/bin}" ]] && export PATH="${PYENV_ROOT}/bin:${PATH}" eval "$(pyenv init - zsh)" + eval "$(pyenv virtualenv-init - zsh)" + __zsh_fix_pyenv_prompt() { + if [[ -v _OLD_VIRTUAL_PS1 ]]; then + PS1="${_OLD_VIRTUAL_PS1}" + unset _OLD_VIRTUAL_PS1 + fi + } + precmd_functions+=(__zsh_fix_pyenv_prompt) fi # Bookmarks