tl;dr: I want my command prompt to be customizable with any color I want and also display the current git branch that I am on.
I am aware that there are at least six different post asking an extremely similar question. I have read the ones I have found and I still have my command prompt cycling and having problem even with their suggestion when I insert colors. There are a few details that make my question different and worthwhile I hope.
Currently this is what my PS1 variable looks like:
PS1='\[\e[0;31m\u \W $(__git_ps1 "(%s)")\$ \e[m\]'
As the other posts suggested, I inserted the:
I am aware that:
ctrl + L
clears the screen but that does not really address the problem that is, that the command prompt should not be acting weird.
One specific problem that it has is that, after I type something and then delete it, the command prompt disappears all together. When I try to look at my command history it also overwrites my command prompt with the history. I believe commands are executed correctly but I am not sure why it behaves weirdly.
Also, the __git_ps1 is a function in a shell script for git that I downloaded at:
I am not sure if that function is the problem or if its the different type of quotes. I have tried different quotes. I have also tried storing the value of what __git_ps1 returns and then putting it in the string. I think I tried it correctly, but if anyone has something that works, I would be very grateful!
Also, I am using bash and a MAC with Mavericks. Just in case this is helpful.