diff options
author | Suraj N. Kurapati <sunaku@gmail.com> | 2011-01-08 18:15:57 -0800 |
---|---|---|
committer | Suraj N. Kurapati <sunaku@gmail.com> | 2011-01-08 18:15:57 -0800 |
commit | 8d2b9d10e5105f9e0af0700e427e0567011ab45b (patch) | |
tree | 0aef7833f9aa62d38fd4b5ddd010c8d0e09b6ff0 /themes/jreese.zsh-theme | |
parent | 7a9cc198196cb0c935afe96e1de249c3a05ad413 (diff) | |
download | zsh-8d2b9d10e5105f9e0af0700e427e0567011ab45b.tar.gz zsh-8d2b9d10e5105f9e0af0700e427e0567011ab45b.tar.bz2 zsh-8d2b9d10e5105f9e0af0700e427e0567011ab45b.zip |
avoid forking subshell to test if user is root
Diffstat (limited to 'themes/jreese.zsh-theme')
-rw-r--r-- | themes/jreese.zsh-theme | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/themes/jreese.zsh-theme b/themes/jreese.zsh-theme index 534664f11..0fa6b4ecd 100644 --- a/themes/jreese.zsh-theme +++ b/themes/jreese.zsh-theme @@ -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%} %~ \ |