From 9e8d716be2869906d1a05f63197da568d0b08e31 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Thu, 19 Jul 2012 15:39:23 -0400 Subject: [PATCH] Add command prompt modifications/ --- .bashrc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.bashrc b/.bashrc index a51c385..3ef02f9 100755 --- a/.bashrc +++ b/.bashrc @@ -5,3 +5,16 @@ alias grep='grep --color' # Case insensitive matching shopt -s nocaseglob + +PS1='\[\t\]' +# Prompt color based on location +if [ "$SSH_CONNECTION" == "" ]; then + # Yellow prompt for local login + PS1="$PS1\[\e[1;32m\][\u@\h \W]" +else + PS1="$PS1\[\e[1;33m\][\u@\h \W]" +fi + +# Ripped from Doug - color based on return code +PS1="$PS1\$(if [ \$? = 0 ]; then echo -e \"\$\"; else echo -e \"\[\033[0;31m\]\$\"; fi)\[\033[0m\] " +