FG_BLACK=$(tput setf 0)
PROMPT=': %(!.%{'"$FG_RED"'%}.)%U%n@%m%u%(!.%{'"$FG_BLACK"'%}.)'${CHROOT}' ${vcs_info_msg_0_}%B%30<..<%~%b %(!.#.>) '
else
- PROMPT=': %(!.%F{red}.)%U%n@%m%u%(!.%f.)'${CHROOT}' ${vcs_info_msg_0_}%B%30<..<%~%b %(!.#.>) '
+ if [ -z "$SSH_CONNECTION" ]; then
+ FG_HOST="$(printf "%.3d" "${$(echo ${SSH_CONNECTION%% *} | md5sum):0:2}")"
+ BG_HOST="$(printf "%.3d" "$(( 256 - $FG_HOST ))")"
+ fi
+
+ PROMPT=': %(!.%F{red}.)%U%n%(!.%f.)@%{$FG[$FG_HOST]$BG[$BG_HOST]%}%m%u%f%k'${CHROOT}' ${vcs_info_msg_0_}%B%30<..<%~%b %(!.#.>) '
fi
case `uname -s` in
--- /dev/null
+#! /bin/zsh
+# A script to make using 256 colors in zsh less painful.
+# P.C. Shyamshankar <sykora@lucentbeing.com>
+#
+# From https://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
+
+typeset -Ag FX FG BG
+
+FX=(
+ reset "\e[00m"
+ bold "\e[01m" no-bold "\e[22m"
+ italic "\e[03m" no-italic "\e[23m"
+ underline "\e[04m" no-underline "\e[24m"
+ blink "\e[05m" no-blink "\e[25m"
+ reverse "\e[07m" no-reverse "\e[27m"
+)
+
+for color in {000..255}; do
+ FG[$color]="\e[38;5;${color}m"
+ BG[$color]="\e[48;5;${color}m"
+done