Skip to content

Instantly share code, notes, and snippets.

@randombenj
Created August 11, 2015 13:30
Show Gist options
  • Save randombenj/4d32faec0a79b01f41a1 to your computer and use it in GitHub Desktop.
Save randombenj/4d32faec0a79b01f41a1 to your computer and use it in GitHub Desktop.
Bash PS1
export PS1='`if [ $? = 0 ]; then echo "\[\e[32m\] ✔ "; else echo "\[\e[31m\] ✘ "; fi`\[\e[00;37m\]\u\[\e[01;37m\]\[\e[01;30m\]@\[\e[00;37m\]\h\[\e[01;37m\]:`[[ $(git status 2> /dev/null | head -n2 | tail -n1) != "# Changes to be committed:" ]] && echo "\[\e[31m\]" || echo "\[\e[33m\]"``[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] || echo "\[\e[32m\]"`$(__git_ps1 "(%s)\[\e[00m\]")\[\e[01;34m\]\w\[\e[00m\]\$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment