This should not happen usually. But better be safe than sorry.
In case something goes wrong we only support _one_ prompt, with the original
root-is-red changeroo. This is good enough as a fallback.
Signed-off-by: Frank Terbeck <ft@grml.org>
fi
else
print 'Notice: no promptinit available :('
-fi
-setopt prompt_subst
+ # Support a fallback, in case promptsys isn't available.
+ setopt prompt_subst
+
+ precmd() { (( ${+functions[vcs_info]} )) && vcs_info; }
+
+ p0="${RED}${EXITCODE}${WHITE}${debian_chroot:+($debian_chroot)}"
+ p1="${BLUE}%n${NO_COLOR}@%m %40<...<%B%~%b%<< "'${vcs_info_msg_0_}'"%# "
+ if (( EUID == 0 )); then
+ PROMPT="${BLUE}${p0}${RED}${p1}"
+ else
+ PROMPT="${RED}${p0}${BLUE}${p1}"
+ fi
+ unset p0 p1
+fi
# make sure to use right prompt only when not running a command
is41 && setopt transient_rprompt