use the same colors on every 256 color term

This commit is contained in:
David Majnemer 2010-08-15 15:43:18 -04:00
parent e271ce7062
commit bacc01d390

View file

@ -1,21 +1,42 @@
# prompt
if [ "${TERM}" != "dumb" ] ; then
RESETCOLOR=$'%{\e[00;00m%}'
if [ -z "${SSH_TTY}" ] ; then
HOSTCOLOR=$'%{\e[01;32m%}'
else
HOSTCOLOR=$'%{\e[01;36m%}'
fi
PATHCOLOR=$'%{\e[01;34m%}'
ERRORCOLOR=$'%{\e[00;31m%}'
BOLDERRORCOLOR=$'%{\e[01;31m%}'
CLOCKCOLOR=$'%{\e[01;33m%}'
JOBCOLOR=$'%{\e[00;36m%}'
RPROMPT=${RESETCOLOR}$'%1(j.'${JOBCOLOR}$'[%j].)%(?..'${ERRORCOLOR}$'[%?])'${CLOCKCOLOR}$'[%t]'${RESETCOLOR}
else
RESETCOLOR=''
HOSTCOLOR=''
PATHCOLOR=''
BOLDERRORCOLOR=''
fi
RESETCOLOR=''
HOSTCOLOR=''
PATHCOLOR=''
BOLDERRORCOLOR=''
case "${TERM}" in
*256color*)
RESETCOLOR=$'%{\e[00;00m%}'
if [ -z "${SSH_TTY}" ] ; then
HOSTCOLOR=$'%{\e[01;38;5;113m%}'
else
HOSTCOLOR=$'%{\e[01;38;5;80m%}'
fi
PATHCOLOR=$'%{\e[38;5;74m%}'
ERRORCOLOR=$'%{\e[38;5;1m%}'
BOLDERRORCOLOR=$'%{\e[01;38;5;9m%}'
CLOCKCOLOR=$'%{\e[01;38;5;221m%}'
JOBCOLOR=$'%{\e[38;5;30m%}'
;;
dumb)
;;
*)
if ( command -v tput >/dev/null 2>&1 ) && [ `tput colors` != -1 ] ; then
RESETCOLOR=$'%{\e[00;00m%}'
if [ -z "${SSH_TTY}" ] ; then
HOSTCOLOR=$'%{\e[01;32m%}'
else
HOSTCOLOR=$'%{\e[01;36m%}'
fi
PATHCOLOR=$'%{\e[01;34m%}'
ERRORCOLOR=$'%{\e[00;31m%}'
BOLDERRORCOLOR=$'%{\e[01;31m%}'
CLOCKCOLOR=$'%{\e[01;33m%}'
JOBCOLOR=$'%{\e[00;36m%}'
fi
;;
esac
PROMPT=${RESETCOLOR}${HOSTCOLOR}$'%n@%m '${PATHCOLOR}$'%45<...<%~ %(?..'${BOLDERRORCOLOR}$')%(!.#.$) '${RESETCOLOR}
RPROMPT=${RESETCOLOR}$'%1(j.'${JOBCOLOR}$'[%j].)%(?..'${ERRORCOLOR}$'[%?])'${CLOCKCOLOR}$'[%t]'${RESETCOLOR}