Fix color change based on

This commit is contained in:
Andrew Tomaka 2013-02-25 14:53:12 -05:00
parent dd5c929439
commit 3c601a4447

View file

@ -21,10 +21,9 @@ function prompt {
PS1="\e[44;1;37m[\t] \w ${LINE}\e[0m\n" PS1="\e[44;1;37m[\t] \w ${LINE}\e[0m\n"
if [ "$SSH_CONNECTION" == "" ]; then if [ "$SSH_CONNECTION" == "" ]; then
# Yellow prompt for local login
PS1="$PS1\[\e[1;32;40m\][\u@\h]" PS1="$PS1\[\e[1;32;40m\][\u@\h]"
else else
PS1="$PS1\[\e[1;32;40m\][\u@\h]" PS1="$PS1\[\e[1;33;40m\][\u@\h]"
fi fi
PS1="$PS1\$(if [ \$? = 0 ]; then echo -e \"\$\"; else echo -e \"\[\e[0;31m\]\$\"; fi)\[\e[0m\] " PS1="$PS1\$(if [ \$? = 0 ]; then echo -e \"\$\"; else echo -e \"\[\e[0;31m\]\$\"; fi)\[\e[0m\] "
} }