From 2f07d57c8698c49a04fad755409b30cb49361bde Mon Sep 17 00:00:00 2001 From: Doncho Gunchev Date: Tue, 16 Jul 2024 15:29:37 +0300 Subject: [PATCH] PyCharm virtual environment with poetry support. --- etc/profile.d/z-ps-twtty-7.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/etc/profile.d/z-ps-twtty-7.sh b/etc/profile.d/z-ps-twtty-7.sh index 6a06f0f..bc6f513 100755 --- a/etc/profile.d/z-ps-twtty-7.sh +++ b/etc/profile.d/z-ps-twtty-7.sh @@ -81,7 +81,11 @@ function prompt_command() { local prompt="--($my_D, Err ${my_P[*]}, $my_TTY)---($PWD)--" if [ -n "${VIRTUAL_ENV:-}" ] && [ -n "$_OLD_VIRTUAL_PS1" ]; then - export my_VENV="${VIRTUAL_ENV##*/}" + if [ -n "$VIRTUAL_ENV_PROMPT" ]; then + export my_VENV="$VIRTUAL_ENV_PROMPT" + else + export my_VENV="${VIRTUAL_ENV##*/}" + fi prompt="--($my_D, Err ${my_P[*]}, $my_TTY, $my_VENV)---($PWD)--" if [ "${PS1:0:${#my_VENV}+3}" == "($my_VENV) " ]; then # PS1 will be restored by virtual environment's deactivate script.