From 5d3b5af7ed3b1bad6ada64a5507720cd2e0280f0 Mon Sep 17 00:00:00 2001 From: Arti Zirk Date: Wed, 21 Jun 2023 20:58:33 +0300 Subject: [PATCH] Add support for showing custom pyvenv prompt --- .zshrc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 820429f..62c652d 100644 --- a/.zshrc +++ b/.zshrc @@ -5,7 +5,13 @@ fpath=( ~/.config/zsh/functions $fpath) # Virtualenv support function _virtual_env_prompt () { - REPLY=${VIRTUAL_ENV+(${VIRTUAL_ENV:t}) } + # 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'