mirror of
https://github.com/NaomiAmethyst/dots.git
synced 2025-04-13 09:30:06 +00:00
use the same colors on every 256 color term
This commit is contained in:
parent
e271ce7062
commit
bacc01d390
1 changed files with 40 additions and 19 deletions
59
zsh/prompt
59
zsh/prompt
|
@ -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}
|
||||
|
|
Loading…
Add table
Reference in a new issue