aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-15 11:29:47 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-15 11:31:47 +1200
commit24e12413661f38be39ffa1c2f7c7c46310b4f3a5 (patch)
treec388129629ca8df957278dde83b7f020b79cc627 /bash/bashrc.d
parentRemove square brackets around prompt (diff)
downloaddotfiles-24e12413661f38be39ffa1c2f7c7c46310b4f3a5.tar.gz
dotfiles-24e12413661f38be39ffa1c2f7c7c46310b4f3a5.zip
Don't use git: prompt prefix if PROMPT_VCS unset
All of my personal stuff is in Git, so this is only really applicable at work
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r--bash/bashrc.d/prompt.bash5
1 files changed, 3 insertions, 2 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 2a18c24c..23c89857 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -130,8 +130,9 @@ prompt() {
state=${state}^
fi
- # Print the status in brackets with a git: prefix
- printf '(git:%s%s)' "${branch:-unknown}" "$state"
+ # Print the status in brackets; add a git: prefix only if there
+ # might be another VCS prompt (because PROMPT_VCS is set)
+ printf '(%s%s%s)' "${PROMPT_VCS:+git:}" "${branch:-unknown}" "$state"
;;
# Subversion prompt function