From 24e12413661f38be39ffa1c2f7c7c46310b4f3a5 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 15 Aug 2016 11:29:47 +1200 Subject: 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 --- pdksh/pdkshrc.d/prompt.pdksh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pdksh') diff --git a/pdksh/pdkshrc.d/prompt.pdksh b/pdksh/pdkshrc.d/prompt.pdksh index 4f4986b6..f97c9096 100644 --- a/pdksh/pdkshrc.d/prompt.pdksh +++ b/pdksh/pdkshrc.d/prompt.pdksh @@ -111,8 +111,8 @@ 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" ;; # Revert to simple inexpensive prompts -- cgit v1.2.3