Created
May 7, 2015 18:55
-
-
Save alertedsnake/27e12a8d6fd424a05a66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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