mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-27 03:14:56 +01:00
display user@host in red if user == root
This commit is contained in:
parent
22632aac7c
commit
979c350ab6
1 changed files with 6 additions and 1 deletions
|
|
@ -1,4 +1,9 @@
|
|||
PROMPT=$'%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\
|
||||
if [ "$USER" = "root" ]
|
||||
then USER_AT_HOST_COLOR="red"
|
||||
else USER_AT_HOST_COLOR="green"
|
||||
fi
|
||||
|
||||
PROMPT=$'%{$fg_bold[$USER_AT_HOST_COLOR]%}%n@%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\
|
||||
%{$fg[blue]%}->%{$fg_bold[blue]%} %#%{$reset_color%} '
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue