Skip to content

Instantly share code, notes, and snippets.

@alertedsnake
Created May 7, 2015 18:55
Show Gist options
  • Save alertedsnake/27e12a8d6fd424a05a66 to your computer and use it in GitHub Desktop.
Save alertedsnake/27e12a8d6fd424a05a66 to your computer and use it in GitHub Desktop.
set_prompt() {
Last_Command=$? # Must come first!
Gray='\[\e[01;30m\]'
Blue='\[\e[01;34m\]'
White='\[\e[01;37m\]'
Purple='\[\e[0;35m\]'
Red='\[\e[01;31m\]'
Green='\[\e[01;32m\]'
Reset='\[\e[00m\]'
FancyX='\342\234\227'
Checkmark='\342\234\223'
PS1=''
# Add a bright white exit status for the last command
# PS1="$White\$Last_Command "
# If it was successful, print a green check mark. Otherwise, print
# a red X.
if [[ $Last_Command != 0 ]]; then
PS1+="$White\$Last_Command "
PS1+="$Red$FancyX "
#else
# PS1+="$Green$Checkmark "
fi
PS1+="$Green\\u$Blue@$Green\\h:$Blue\\w\\\$$Reset "
# AWS environment display
if [[ ! -z $AWS_ENV ]]; then
PS1="$Gray${AWS_ENV} ${PS1}"
fi
}
PROMPT_COMMAND='set_prompt'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment