summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReiner Herrmann <reiner@reiner-h.de>2017-10-07 11:57:30 +0200
committerReiner Herrmann <reiner@reiner-h.de>2017-10-07 11:57:30 +0200
commit309df224abe1d8fc4061c6107243259858f4d253 (patch)
tree7544c582e3afef9bf3e20396f6a80ab4d1d635b1
parentfc7f76ceb771987f435d9c5e1187093a05f8c7ab (diff)
bashrc: call __git_ps1 only if it is defined
-rw-r--r--bashrc3
1 files changed, 2 insertions, 1 deletions
diff --git a/bashrc b/bashrc
index 7c1fb49..99cc2d2 100644
--- a/bashrc
+++ b/bashrc
@@ -51,8 +51,9 @@ red='\[\033[0;31m\]'
red_b='\[\033[1;31m\]'
[ $(id -u) -eq 0 ] && user_color=$red_b || user_color=$yellow_b
nrjobs='$([ \j -gt 0 ] && echo " [\j]")'
+gitps='$(type -t __git_ps1 &>/dev/null && __git_ps1)'
[ -n "$debian_chroot" ] && chroot="[$debian_chroot] "
-PS1=${TITLE}"($user_color\u$reset@$green\h$reset) $chroot\W\$(__git_ps1)$nrjobs $red\\\$$reset > "
+PS1=${TITLE}"($user_color\u$reset@$green\h$reset) $chroot\W$gitps$nrjobs $red\\\$$reset > "
export PATH=~/Apps/bin:$PATH
export EDITOR="/usr/bin/vim"