dotfiles/.zsh/lib/30-prompt.zsh

22 lines
440 B
Bash
Raw Normal View History

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
PROMPT='%F{red}%n@%m%f '
2016-04-16 16:31:54 +02:00
else
PROMPT='%F{blue}%n@%m%f '
2016-04-16 16:31:54 +02:00
fi
PROMPT+='%F{yellow}%~%f '
2016-04-16 16:31:54 +02:00
# Change green arrows (⇣⇡) if connection is via ssh
2020-06-02 15:59:14 +02:00
if [[ "${SSH_CONNECTION}" ]]; then
PROMPT+="%F{green}⇣⇡%f %F{white}〉%f";
2016-04-16 16:31:54 +02:00
else
PROMPT+="%F{white}〉%f";
2016-04-16 16:31:54 +02:00
fi;
PROMPT+='%{$reset_color%}'