From 36de37c24fc3675921afde9a6547ec7819ddc999 Mon Sep 17 00:00:00 2001 From: Nicole Tietz-Sokolskaya Date: Sat, 25 Jun 2011 16:23:38 -0400 Subject: [PATCH] Updated title bar. --- profile | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/profile b/profile index 9b1b1c7..9c9e7d7 100644 --- a/profile +++ b/profile @@ -1,18 +1,26 @@ -# PS1="\[\033]0;\@ [\u@\h] [\w]\007\]\[\033[1;33m\]\@ \[\033[1;37m\][\[\033[1;35m\]\u\[\033[1;37m\]@\[\033[1;32m\]\h\[\033[1;37m\]] \[\033[1;37m\][\[\033[1;31m\]\w\[\033[1;37m\]] [\[\033[1;36m\]$(ls -l | grep "^-" | wc -l | tr -d " ") \[\033[1;34m\]files\[\033[1;37m\]] \n\[\033[1;33m\]\@ \[\033[1;37m\]$ \[\033[0m\]" +# PS1="\[\e]0;\@ [\u@\h] [\w]\007\]\[\e[1;33m\]\@ \[\e[1;37m\][\[\e[1;35m\]\u\[\e[1;37m\]@\[\e[1;32m\]\h\[\e[1;37m\]] \[\e[1;37m\][\[\e[1;31m\]\w\[\e[1;37m\]] [\[\e[1;36m\]$(ls -l | grep "^-" | wc -l | tr -d " ") \[\e[1;34m\]files\[\e[1;37m\]] \n\[\e[1;33m\]\@ \[\e[1;37m\]$ \[\e[0m\]" function prompt { - local BLUE="\[\033[0;34m\]" - local DARK_BLUE="\[\033[1;34m\]" - local RED="\[\033[0;31m\]" - local DARK_RED="\[\033[1;31m\]" - local GREEN="\[\033[0;32m\]" - local NO_COLOR="\[\033[0m\]" + local BLUE="\[\e[0;34m\]" + local DARK_BLUE="\[\e[1;34m\]" + local RED="\[\e[0;31m\]" + local DARK_RED="\[\e[1;31m\]" + local GREEN="\[\e[0;32m\]" + local NO_COLOR="\[\e[0m\]" + + case $TERM in + xterm*|screen) + TITLEBAR='\[\e]0;\u@\h \w\007\]'; + ;; + *) + TITLEBAR=""; + ;; + esac - TITLEBAR='\[\033]0;\u@\h:\w\007\]' FAILURE_COLOR="if [[ \$? = '0' ]]; then echo \"$GREEN\"; else echo \"$RED\"; fi" - PS1="$BLUE[\t] \`$FAILURE_COLOR\` \u@\h> $NO_COLOR" + PS1="${TITLEBAR}$BLUE[\t] \`$FAILURE_COLOR\` \u@\h> $NO_COLOR" } prompt