aboutsummaryrefslogtreecommitdiff
path: root/.bashrc
diff options
context:
space:
mode:
Diffstat (limited to '.bashrc')
-rw-r--r--.bashrc10
1 files changed, 9 insertions, 1 deletions
diff --git a/.bashrc b/.bashrc
index 54c0aa0..511ae17 100644
--- a/.bashrc
+++ b/.bashrc
@@ -72,6 +72,12 @@ __precmd()
PS1+="\001$SHELLC_F_LIGHTGRAY\002:\001$SHELLC_RESET_COLOR_F\002"
PS1+="\001$SHELLC_F_BLUE\002\w\001$SHELLC_RESET_COLOR_F\002"
+ # Add venv indicator
+ if [[ -n "$PYTHON_VENV_DIR" ]]
+ then
+ PS1+="\001$SHELLC_F_CYAN\002#$(awk -F/ '{ print $(NF-1) }' <<< "$PYTHON_VENV_DIR")\001$SHELLC_RESET_COLOR_F\002"
+ fi
+
# Add git status
if git rev-parse --is-inside-work-tree &> /dev/null
then
@@ -98,11 +104,13 @@ __precmd()
fi
# Add the exit code of the previous command
- PS1+=" "
+ PS1+=" "
if [[ $previous_exit -ne 0 ]]
then
PS1+="\001$SHELLC_F_RED\002"
+ else
+ PS1+="\001$SHELLC_F_LIGHTGRAY\002"
fi
PS1+="$(printf "%03i" "$previous_exit")\001$SHELLC_RESET_COLOR_F\002"