[zsh] display the current pyenv version in the prompt

This commit is contained in:
Dmytro Meleshko 2021-02-02 22:50:51 +02:00
parent 124221d1e3
commit 56ed052f85

View file

@ -1,7 +1,5 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
export VIRTUAL_ENV_DISABLE_PROMPT=false
# Escapes `%` in all arguments by replacing it with `%%`. Escaping is needed so # Escapes `%` in all arguments by replacing it with `%%`. Escaping is needed so
# that untrusted input (e.g. git branch names) doesn't affect prompt rendering. # that untrusted input (e.g. git branch names) doesn't affect prompt rendering.
prompt_escape() { prompt_escape() {
@ -102,6 +100,11 @@ PROMPT+='$(prompt_vcs_info 2>/dev/null)'
# Python's virtualenv # Python's virtualenv
PROMPT+='${VIRTUAL_ENV:+" %F{blue}venv:%F{magenta}${VIRTUAL_ENV:t}%f"}' PROMPT+='${VIRTUAL_ENV:+" %F{blue}venv:%F{magenta}${VIRTUAL_ENV:t}%f"}'
VIRTUAL_ENV_DISABLE_PROMPT=true
# pyenv
PROMPT+='${PYENV_VERSION:+" %F{blue}pyenv:%F{magenta}${PYENV_VERSION:t}%f"}'
PYENV_VIRTUAL_ENV_DISABLE_PROMPT=true
PROMPT+=' ' PROMPT+=' '