1
0
mirror of https://github.com/artizirk/dotfiles.git synced 2024-11-25 09:20:58 +02:00

Add support for showing custom pyvenv prompt

This commit is contained in:
Arti Zirk 2023-06-21 20:58:33 +03:00
parent b47f79401f
commit 5d3b5af7ed

6
.zshrc
View File

@ -5,7 +5,13 @@ fpath=( ~/.config/zsh/functions $fpath)
# Virtualenv support
function _virtual_env_prompt () {
# new pyvenv has a seperate variable for custom prompt value
REPLY=${VIRTUAL_ENV_PROMPT+${VIRTUAL_ENV_PROMPT}}
# support old-school virtualenv
if [[ -z "${REPLY}" ]]; then
REPLY=${VIRTUAL_ENV+(${VIRTUAL_ENV:t}) }
fi
}
grml_theme_add_token virtual-env -f _virtual_env_prompt '%F{magenta}' '%f'