dots/zsh/prompt

50 lines
1.2 KiB
Text
Raw Normal View History

# prompt
RESETCOLOR=''
HOSTCOLOR=''
PATHCOLOR=''
BOLDERRORCOLOR=''
BLACKCOLOR=''
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%}'
2010-09-19 16:40:57 -05:00
if [ "${TERM_PROGRAM}" = "Apple_Terminal" ] ; then
BLACKCOLOR=$'%{\e[00;30m%}'
else
BLACKCOLOR=$'%{\e[38;5;232m%}'
fi
;;
dumb)
;;
*)
2010-09-02 11:49:57 -05:00
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%}'
2010-09-02 22:00:55 -05:00
BLACKCOLOR=$'%{\e[00;30m%}'
fi
;;
esac
2010-09-02 22:00:55 -05:00
PROMPT=${RESETCOLOR}${HOSTCOLOR}$'%n@'${LHOSTNAME}${BLACKCOLOR}':'${PATHCOLOR}$'%45<...<%~ %(?..'${BOLDERRORCOLOR}$')%(!.#.$) '${RESETCOLOR}
RPROMPT=${RESETCOLOR}$'%1(j.'${JOBCOLOR}$'[%j].)%(?..'${ERRORCOLOR}$'[%?])'${CLOCKCOLOR}$'[%t]'${RESETCOLOR}