jimeh / git-aware-prompt

Display current Git branch name in your terminal prompt when in a Git working directory.
Creative Commons Zero v1.0 Universal
2.16k stars 340 forks source link

Ubuntu colorized prompt PS1 causes export command to be outputted at start of every shell #50

Open patflynn opened 7 years ago

patflynn commented 7 years ago

I'm a bit clueless when it comes to Bash/Linux so this is probably due to user error, but when I use the colorized ubuntu PS1 I see the following:

]0;export PS1="\${debian_chroot:+(\$debian_chroot)}\[\]\u@\h\[\]:\[\]\w\[\] \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "user@host:~ $

whenever I start a new shell.

I copy and pasted: export PS1="\${debian_chroot:+(\$debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "

Directly from the instructions. The non-colorized version has no issue.

patflynn commented 7 years ago

Just to be more explicit. I copy and pasted:

export GITAWAREPROMPT=~/.bash/git-aware-prompt
source "${GITAWAREPROMPT}/main.sh"

export PS1="\${debian_chroot:+(\$debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "

into my .bashrc