Created
July 22, 2014 08:54
-
-
Save mdaley/efe51dff8cb92265b637 to your computer and use it in GitHub Desktop.
Git bash prompt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This sorts out the problem of lines not wrapping properly. | |
export PS1='\[\e]0;\u@\h: \w\a\]\[\e[32;1m\]${debian_chroot:+($debian_chroot)}\u@\h:\w \[\e[33;1m\]$(__git_ps1 "[%s] ")\[\e[32;1m\]\$ \[\e[0m\]' | |
Copy exactly into your .bashrc. Note that __git_ps1 is a builtin (comes with git I assume) feature that provides the branch you are on if you are in a git area. There's no need for a separate function to obtain this information. | |
Read this page if interested about what all the funny, cryptic characters are all about: | |
http://www.ibm.com/developerworks/linux/library/l-tip-prompt/ | |
(and to change the colours and background if you want to.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment