dotfiles/zsh/prompt_server.zsh
2016-06-29 14:23:11 +03:00

28 lines
862 B
Bash

# PROMPT && RPROMPT
if [[ $EUID == 0 ]]; then
# [root@host dir]#
PROMPT="%{$fg_bold[white]%}[%{$reset_color%}\
%{$fg_bold[red]%}%n%{$reset_color%}\
%{$fg_bold[white]%}@%{$reset_color%}\
%{$fg_no_bold[blue]%}%M %{$reset_color%}\
%{$fg_bold[yellow]%}%1/%{$reset_color%}\
%{$fg_bold[white]%}]# %{$reset_color%}"
else
# [user@host dir]$
PROMPT="%{$fg_bold[white]%}[%{$reset_color%}\
%{$fg_bold[green]%}%n%{$reset_color%}\
%{$fg_bold[white]%}@%{$reset_color%}\
%{$fg_no_bold[blue]%}%M %{$reset_color%}\
%{$fg_bold[yellow]%}%1/%{$reset_color%}\
%{$fg_bold[white]%}]$ %{$reset_color%}"
fi
precmd() {
# last command
returncode="%(?.%{$fg[green]%}.%{$fg[red]%})%?%{$resetcolor%}"
RPROMPT="%{$fg_bold[white]%}[%{$reset_color%}\
%{$fg_bold[cyan]%}%T%{$reset_color%}\
%{$fg_bold[white]%}][%{$reset_color%}"\
${returncode}\
"%{$fg_bold[white]%}]%{$reset_color%}"
}