Skip to content

Instantly share code, notes, and snippets.

@ramazanpolat
Last active July 30, 2020 19:57
Show Gist options
  • Save ramazanpolat/447484998e9f21e734fa27ce61d8ad50 to your computer and use it in GitHub Desktop.
Save ramazanpolat/447484998e9f21e734fa27ce61d8ad50 to your computer and use it in GitHub Desktop.
Colored bash prompt. When exitcode OK it is happy :) Otherwise it is sad :(
export PS1='\[\e[33m\]\u@\h:\w\[\e[0m\] $(if [[ $? == 0 ]]; then echo "\[$(tput setaf 2)\]:) "; else echo "\[\e[31m\]:( "; fi)\[$(tput sgr0)\]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment