1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-06-14 09:51:41 +00:00

avoid forking subshell to test if user is root

This commit is contained in:
Suraj N. Kurapati
2011-01-08 18:15:57 -08:00
parent ae13d5d346
commit c56082c690
7 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,6 @@
# ZSH Theme - Preview: http://dl.dropbox.com/u/1552408/Screenshots/2010-04-08-oh-my-zsh.png
if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
PROMPT='%{$fg[$NCOLOR]%}%n%{$fg[green]%}@%m%{$reset_color%} %~ \