diff options
author | Óscar Nájera <hi@oscarnajera.com> | 2022-09-26 19:34:40 +0200 |
---|---|---|
committer | Óscar Nájera <hi@oscarnajera.com> | 2022-09-26 19:34:40 +0200 |
commit | 8aa2fc98495419176084d3f6825c583285a969d8 (patch) | |
tree | 6ff68cefc40492bc3f85f37a05f5ee4462634ff4 | |
parent | 5541441bdb538ace6e060abec96e7c7345e7f7a5 (diff) | |
download | dotfiles-8aa2fc98495419176084d3f6825c583285a969d8.tar.gz dotfiles-8aa2fc98495419176084d3f6825c583285a969d8.tar.bz2 dotfiles-8aa2fc98495419176084d3f6825c583285a969d8.zip |
python virtual env
-rw-r--r-- | home-dots/dot-bashrc | 9 |
1 files changed, 8 insertions, 1 deletions
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}" |