aboutsummaryrefslogtreecommitdiffstats
path: root/home-dots/dot-bashrc
diff options
context:
space:
mode:
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
commit8aa2fc98495419176084d3f6825c583285a969d8 (patch)
tree6ff68cefc40492bc3f85f37a05f5ee4462634ff4 /home-dots/dot-bashrc
parent5541441bdb538ace6e060abec96e7c7345e7f7a5 (diff)
downloaddotfiles-8aa2fc98495419176084d3f6825c583285a969d8.tar.gz
dotfiles-8aa2fc98495419176084d3f6825c583285a969d8.tar.bz2
dotfiles-8aa2fc98495419176084d3f6825c583285a969d8.zip
python virtual env
Diffstat (limited to 'home-dots/dot-bashrc')
-rw-r--r--home-dots/dot-bashrc9
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}"