Skip to content

Instantly share code, notes, and snippets.

@krbullock
Created September 17, 2009 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krbullock/188679 to your computer and use it in GitHub Desktop.
Save krbullock/188679 to your computer and use it in GitHub Desktop.
kbullock@x-134-84-64-185 15:06:11
~ ❧ false
☹ kbullock@x-134-84-64-185 15:06:31
~ ❧ true
kbullock@x-134-84-64-185 15:10:41
~ ❧
# De ugly, ugly code what duz it:
# start with basics
PS1='\u@\h \t $(__hg_ps1)'$'\n''\w '$'\xe2\x9d\xa7 '
# prepend the frowny-face for non-zero exit status
PS1='`if [ \$? != 0 ];then echo "\[\e[31m\]'$'\xe2\x98\xb9''\[\e[0m\] ";fi`'$PS1
# add a newline at the beginning so the prompt doesn't eat output
PS1=$'\n'$PS1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment