aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2023-10-25 08:28:27 +0200
committerPatrick Spek <p.spek@tyil.nl>2023-10-25 08:28:33 +0200
commit97fe4b3cfc677928653e80b13ba6070c5e5f57e8 (patch)
tree97fdfc6a97bb4aa24a60c456e7fdab042dfc6b71
parentc30eb001ff1f9b04e7d75b88653cb4e3ad10ebc9 (diff)
Add if-statement around venv prompt
-rw-r--r--.bashrc5
1 files changed, 4 insertions, 1 deletions
diff --git a/.bashrc b/.bashrc
index d5f0250..511ae17 100644
--- a/.bashrc
+++ b/.bashrc
@@ -73,7 +73,10 @@ __precmd()
PS1+="\001$SHELLC_F_BLUE\002\w\001$SHELLC_RESET_COLOR_F\002"
# Add venv indicator
- PS1+="\001$SHELLC_F_CYAN\002#$(awk -F/ '{ print $(NF-1) }' <<< "$PYTHON_VENV_DIR")\001$SHELLC_RESET_COLOR_F\002"
+ 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