summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bashprompt23
1 files changed, 19 insertions, 4 deletions
diff --git a/.bashprompt b/.bashprompt
index 96f92eb..062dd26 100644
--- a/.bashprompt
+++ b/.bashprompt
@@ -18,6 +18,11 @@ __show-hostname ()
esac
}
+__have-gitprompt ()
+{
+ [ -f /usr/lib/git-core/git-sh-prompt ]
+}
+
__set-title ()
{
local title
@@ -124,7 +129,12 @@ __set-prompt ()
PS1+=$(__fontify : dim)
PS1+=$(__fontify '\w' bold blue)
- PS1+=$(__fontify "$(__git_ps1 '(%s)')" red)
+
+ if [ ${PS1_SHOWGITSTATUS} ]
+ then
+ PS1+=$(__fontify "$(__git_ps1 '(%s)')" red)
+ fi
+
PS1+=$(__fontify '\$' dim)
PS1+=' '
@@ -170,8 +180,13 @@ __refresh-terminal ()
}
-. /usr/lib/git-core/git-sh-prompt
-GIT_PS1_SHOWDIRTYSTATE=t
-GIT_PS1_SHOWUPSTREAM=auto
+if __have-gitprompt
+then
+ . /usr/lib/git-core/git-sh-prompt
+ GIT_PS1_SHOWDIRTYSTATE=t
+ GIT_PS1_SHOWUPSTREAM=auto
+
+ PS1_SHOWGITSTATUS=t
+fi
export PROMPT_COMMAND=__refresh-terminal