summaryrefslogtreecommitdiff
path: root/themes/gentoo.zsh-theme
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2012-12-02 12:10:32 -0800
committerRobby Russell <robby@planetargon.com>2012-12-02 12:10:32 -0800
commit423d66da5b7d093ad921627e7ae0bb6bc01e7626 (patch)
treec27a9f7d21dd9333edc24ce4598b33aa940b26ba /themes/gentoo.zsh-theme
parentc64c30ce9379573e672593bab2646703ede0727c (diff)
parentf0451195f63b3607461bda1570c5fb2a4e429b3e (diff)
downloadzsh-423d66da5b7d093ad921627e7ae0bb6bc01e7626.tar.gz
zsh-423d66da5b7d093ad921627e7ae0bb6bc01e7626.tar.bz2
zsh-423d66da5b7d093ad921627e7ae0bb6bc01e7626.zip
Merge pull request #409 from Bregor/patch-1
Dollar sign instead of percent in unprivileged user prompt (as in real ge
Diffstat (limited to 'themes/gentoo.zsh-theme')
-rw-r--r--themes/gentoo.zsh-theme6
1 files changed, 5 insertions, 1 deletions
diff --git a/themes/gentoo.zsh-theme b/themes/gentoo.zsh-theme
index cba143d42..ee205d248 100644
--- a/themes/gentoo.zsh-theme
+++ b/themes/gentoo.zsh-theme
@@ -1,4 +1,8 @@
-PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%#%{$reset_color%} '
+function prompt_char {
+ if [ $UID -eq 0 ]; then echo "#"; else echo $; fi
+}
+
+PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%_$(prompt_char)%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX="("
ZSH_THEME_GIT_PROMPT_SUFFIX=") "