Permalink
Browse files

Fix bug in git-enabled color PS1

  • Loading branch information...
1 parent 7668fa4 commit 24b580ecd2dd8165f1b6f75857007167f710c619 @tdudziak committed Jun 8, 2012
Showing with 1 addition and 3 deletions.
  1. +1 −3 .bashrc
View
@@ -50,12 +50,10 @@ function __git_ps1_color {
elif $(echo "$status" | egrep "^\w?A|M|D" > /dev/null); then
tput setaf 2 # green: changes in index
fi
- __git_ps1
- tput sgr0 # text reset
}
if [ "$color_prompt" = yes ]; then
- PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]`__git_ps1_color`\$ '
+ PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[$(__git_ps1_color)\]$(__git_ps1)\[$(tput sgr0)\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w`__git_ps1`\$ '
fi

0 comments on commit 24b580e

Please sign in to comment.