1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-26 10:13:37 +08:00

feat(pyenv): don't load pyenv-virtualenv with ZSH_PYENV_VIRTUALENV=false

Closes #9443

Co-authored-by: Pandu POLUAN <pepoluan@gmail.com>
This commit is contained in:
Marc Cornellà 2021-09-03 12:56:00 +02:00
parent 823be4ef5f
commit 1b03896a0e
No known key found for this signature in database
GPG Key ID: 0314585E776A9C1B
2 changed files with 4 additions and 1 deletions

View File

@ -15,6 +15,9 @@ plugins=(... pyenv)
- `ZSH_PYENV_QUIET`: if set to `true`, the plugin will not print any messages if it - `ZSH_PYENV_QUIET`: if set to `true`, the plugin will not print any messages if it
finds that `pyenv` is not properly configured. finds that `pyenv` is not properly configured.
- `ZSH_PYENV_VIRTUALENV`: if set to `false`, the plugin will not load pyenv-virtualenv
when it finds it.
## Functions ## Functions
- `pyenv_prompt_info`: displays the Python version in use by pyenv; or the global Python - `pyenv_prompt_info`: displays the Python version in use by pyenv; or the global Python

View File

@ -78,7 +78,7 @@ if [[ $FOUND_PYENV -eq 1 ]]; then
eval "$(pyenv init - --no-rehash zsh)" eval "$(pyenv init - --no-rehash zsh)"
# If pyenv-virtualenv exists, load it # If pyenv-virtualenv exists, load it
if [[ -d "$PYENV_ROOT/plugins/pyenv-virtualenv" ]]; then if [[ -d "$PYENV_ROOT/plugins/pyenv-virtualenv" && "$ZSH_PYENV_VIRTUALENV" != false ]]; then
eval "$(pyenv virtualenv-init - zsh)" eval "$(pyenv virtualenv-init - zsh)"
fi fi