diff options
author | Patrick Spek <p.spek@tyil.nl> | 2023-10-25 08:28:27 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2023-10-25 08:28:33 +0200 |
commit | 97fe4b3cfc677928653e80b13ba6070c5e5f57e8 (patch) | |
tree | 97fdfc6a97bb4aa24a60c456e7fdab042dfc6b71 | |
parent | c30eb001ff1f9b04e7d75b88653cb4e3ad10ebc9 (diff) |
Add if-statement around venv prompt
-rw-r--r-- | .bashrc | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |