From 2a2eeecbfd99ebaf0a3c75b83219337f4b29a1f9 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Fri, 7 Feb 2025 14:22:17 +0100 Subject: [PATCH] [bash] include VIRTUAL_ENV_PROMPT in PS1 --- bash/bashrc.d/prompt_command.bash | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bash/bashrc.d/prompt_command.bash b/bash/bashrc.d/prompt_command.bash index 5bff5d0..aaf6868 100644 --- a/bash/bashrc.d/prompt_command.bash +++ b/bash/bashrc.d/prompt_command.bash @@ -147,6 +147,8 @@ function __prompt_command() { PS1+=" " fi + PS1+="$(parse_python_venv)" + # user@hostname if color ; then PS1+="$(__colored_username)" @@ -344,3 +346,10 @@ function parse_git_dirty { echo "" fi } + +# get activated Python VirtualENV +function parse_python_venv { + if [ ! -z "${VIRTUAL_ENV_PROMPT}" ]; then + echo "$VIRTUAL_ENV_PROMPT" + fi +}