dots/zsh/prompt

43 lines
1 KiB
Text
Raw Normal View History

# prompt
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
2010-05-02 15:59:34 -05:00
PROMPT=${RESETCOLOR}${HOSTCOLOR}$'%n@%m '${PATHCOLOR}$'%45<...<%~ %(?..'${BOLDERRORCOLOR}$')%(!.#.$) '${RESETCOLOR}
RPROMPT=${RESETCOLOR}$'%1(j.'${JOBCOLOR}$'[%j].)%(?..'${ERRORCOLOR}$'[%?])'${CLOCKCOLOR}$'[%t]'${RESETCOLOR}