From 60f8ca378893a5e2d19126f948fef152d64fd7dd Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Tue, 2 Feb 2021 22:50:51 +0200 Subject: [PATCH] [zsh] display the current pyenv version in the prompt --- zsh/prompt.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zsh/prompt.zsh b/zsh/prompt.zsh index 0644c0a..aa79b0e 100644 --- a/zsh/prompt.zsh +++ b/zsh/prompt.zsh @@ -1,7 +1,5 @@ #!/usr/bin/env zsh -export VIRTUAL_ENV_DISABLE_PROMPT=false - # 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. prompt_escape() { @@ -102,6 +100,11 @@ PROMPT+='$(prompt_vcs_info 2>/dev/null)' # Python's virtualenv 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+=' '