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 # prompt
if [ "${TERM}" != "dumb" ] ; then RESETCOLOR=''
RESETCOLOR=$'%{\e[00;00m%}' HOSTCOLOR=''
if [ -z "${SSH_TTY}" ] ; then PATHCOLOR=''
HOSTCOLOR=$'%{\e[01;32m%}' BOLDERRORCOLOR=''
else
HOSTCOLOR=$'%{\e[01;36m%}' case "${TERM}" in
fi *256color*)
PATHCOLOR=$'%{\e[01;34m%}' RESETCOLOR=$'%{\e[00;00m%}'
ERRORCOLOR=$'%{\e[00;31m%}' if [ -z "${SSH_TTY}" ] ; then
BOLDERRORCOLOR=$'%{\e[01;31m%}' HOSTCOLOR=$'%{\e[01;38;5;113m%}'
CLOCKCOLOR=$'%{\e[01;33m%}' else
JOBCOLOR=$'%{\e[00;36m%}' HOSTCOLOR=$'%{\e[01;38;5;80m%}'
RPROMPT=${RESETCOLOR}$'%1(j.'${JOBCOLOR}$'[%j].)%(?..'${ERRORCOLOR}$'[%?])'${CLOCKCOLOR}$'[%t]'${RESETCOLOR} fi
else PATHCOLOR=$'%{\e[38;5;74m%}'
RESETCOLOR='' ERRORCOLOR=$'%{\e[38;5;1m%}'
HOSTCOLOR='' BOLDERRORCOLOR=$'%{\e[01;38;5;9m%}'
PATHCOLOR='' CLOCKCOLOR=$'%{\e[01;38;5;221m%}'
BOLDERRORCOLOR='' JOBCOLOR=$'%{\e[38;5;30m%}'
fi ;;
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} PROMPT=${RESETCOLOR}${HOSTCOLOR}$'%n@%m '${PATHCOLOR}$'%45<...<%~ %(?..'${BOLDERRORCOLOR}$')%(!.#.$) '${RESETCOLOR}
RPROMPT=${RESETCOLOR}$'%1(j.'${JOBCOLOR}$'[%j].)%(?..'${ERRORCOLOR}$'[%?])'${CLOCKCOLOR}$'[%t]'${RESETCOLOR}