Last active
October 26, 2015 13:02
-
-
Save AVGP/43a17bc96013209084c2 to your computer and use it in GitHub Desktop.
Shell prompt that displays the current user, the working directory and the current mercurial bookmark.
This file contains hidden or 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
| DEFAULT="[0m" | |
| PINK="[35m" | |
| GREEN="[32m" | |
| ORANGE="[33m" | |
| hg_branch() { | |
| BOOKMARK=`hg branch 2> /dev/null` | |
| if [ -n "$BOOKMARK" ]; then | |
| BOOKMARK="\e${DEFAULT} on \e${ORANGE}$BOOKMARK\e${DEFAULT}" | |
| fi | |
| echo -e "$BOOKMARK" | |
| } | |
| export PS1='\n\e${PINK}\u \ | |
| \e${DEFAULT}in \e${GREEN}\w\ | |
| \e${DEFAULT}$(hg_branch) \n\$ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment