浏览代码

theme/gallifrey: set color to red if root (#6203)

Brian Hong 5 年之前
父节点
当前提交
851899e59e
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      themes/gallifrey.zsh-theme

+ 6 - 3
themes/gallifrey.zsh-theme

@@ -1,8 +1,11 @@
-# ZSH Theme - Preview: https://flic.kr/p/ZFvivf
-local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
+# ZSH Theme - Preview: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#gallifrey
+return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
+host_color="%(!.%{$fg[red]%}.%{$fg[green]%})"
 
-PROMPT='%{$fg[green]%}%m%{$reset_color%} %2~ $(git_prompt_info)%{$reset_color%}%B»%b '
+PROMPT="${host_color}%m%{$reset_color%} %2~ \$(git_prompt_info)%{$reset_color%}%B»%b "
 RPS1="${return_code}"
 
 ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
 ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
+
+unset return_code host_color