From 8aa2fc98495419176084d3f6825c583285a969d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20N=C3=A1jera?= Date: Mon, 26 Sep 2022 19:34:40 +0200 Subject: python virtual env --- home-dots/dot-bashrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/home-dots/dot-bashrc b/home-dots/dot-bashrc index 3286e43..aefd08b 100644 --- a/home-dots/dot-bashrc +++ b/home-dots/dot-bashrc @@ -34,6 +34,13 @@ git_current_branch() { echo "  ${ref#refs/heads/}" } +python_current_venv() { + local orange="\[\e[0;91m\]" + if [[ -n ${VIRTUAL_ENV_PROMPT} ]]; then + echo " ${orange}${VIRTUAL_ENV_PROMPT}" + fi +} + function __prompt_command { # Must collect exit code very first thing # Just calculating git_branch changes the exit code @@ -46,7 +53,7 @@ function __prompt_command { local normal="\[\e[0m\]" local blue="\[\e[0;34m\]" - PS1="\u@\h ${green}\w${blue}$(git_current_branch)" + PS1="\u@\h ${green}\w${blue}$(git_current_branch)$(python_current_venv)" if [[ "${EXIT}" -ne 0 ]]; then PS1+=" ${red}✗ ${yellow}${EXIT}${orange}" -- cgit v1.2.3