Created
November 3, 2011 07:48
-
-
Save skreutzberger/1335993 to your computer and use it in GitHub Desktop.
Custom Terminal 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
# add the following block to your ~/.bash_profile | |
# it will print more information and an extra char at the new line | |
# you can also use the Apple logo as character, just replace ⌘ with | |
function parse_git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo "("${ref#refs/heads/}")" | |
} | |
GREEN="\[\033[0;32m\]" | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
WHITE="\[\033[01;37m\]" | |
RESET="\[\033[00m\]" | |
export PS1="\u@\h${GREEN}\$(parse_git_branch)${RESET}:$YELLOW\w$RESET\n${WHITE}${RESET}⌘ " | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment