2016-04-16 16:31:54 +02:00
|
|
|
setopt prompt_subst
|
|
|
|
autoload -U promptinit
|
|
|
|
promptinit
|
|
|
|
|
|
|
|
# Change user name color to red if logged in as root
|
|
|
|
if [[ $UID == 0 || $EUID == 0 ]]; then
|
2016-04-16 21:05:07 +02:00
|
|
|
PROMPT='%F{red}%n@%m%f '
|
2016-04-16 16:31:54 +02:00
|
|
|
else
|
2016-04-16 21:05:07 +02:00
|
|
|
PROMPT='%F{blue}%n@%m%f '
|
2016-04-16 16:31:54 +02:00
|
|
|
fi
|
|
|
|
|
2016-04-16 21:05:07 +02:00
|
|
|
PROMPT+='%F{yellow}%~%f '
|
2016-04-16 16:31:54 +02:00
|
|
|
|
2016-04-16 21:05:07 +02:00
|
|
|
# Change green arrows (⇣⇡) if connection is via ssh
|
2020-05-19 23:41:02 +02:00
|
|
|
if [[ "${SSH_CLIENT}" ]]; then
|
2016-04-16 21:05:07 +02:00
|
|
|
PROMPT+="%F{green}⇣⇡%f %F{white}〉%f";
|
2016-04-16 16:31:54 +02:00
|
|
|
else
|
2016-04-16 21:05:07 +02:00
|
|
|
PROMPT+="%F{white}〉%f";
|
2016-04-16 16:31:54 +02:00
|
|
|
fi;
|
|
|
|
|
2016-04-16 21:05:07 +02:00
|
|
|
PROMPT+='%{$reset_color%}'
|