mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-10-03 00:13:50 +02:00
avoid forking subshell to test if user is root
This commit is contained in:
1 parent
7a9cc19819
commit
8d2b9d10e5
7 files changed
+7
-7
No files matched your search
@@ -5,7 +5,7 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
|
||||
function prompt_char {
|
||||
if [ "$(whoami)" = "root" ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi
|
||||
if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi
|
||||
}
|
||||
|
||||
PROMPT='%(?, ,%{$fg[red]%}FAIL%{$reset_color%}
|
||||
|
||||
Reference in new issue
Block a user