Skip to content

Instantly share code, notes, and snippets.

@tylorr
Last active December 27, 2015 11:39
Show Gist options
  • Save tylorr/7320077 to your computer and use it in GitHub Desktop.
Save tylorr/7320077 to your computer and use it in GitHub Desktop.
.bash_profile additions
export PROMPT_COMMAND=__prompt_command
# color coded
# red blue green yellow
# [errnum] username@hostname dir
# $
function __prompt_command() {
local EXIT="$?"
PS1="\n"
if [ $EXIT != 0 ]; then
PS1+="\[\e[1;31m\]$EXIT\[\e[m\] "
fi
PS1+="\[\e[36m\]\u\[\e[m\]@\[\e[32m\]\h\[\e[m\] \[\e[33;1m\]\w\[\e[m\]\n\$ "
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment