浏览代码

highlight the username when root

Felds Liscia 11 年之前
父节点
当前提交
4d83da770a
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      themes/ys.zsh-theme

+ 13 - 0
themes/ys.zsh-theme

@@ -32,3 +32,16 @@ PROMPT="
 ${git_info} \
 %{$fg[white]%}[%*]
 %{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"
+
+if [[ "$(whoami)" == "root" ]]; then
+PROMPT="
+%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \
+%{$bg[yellow]%}%{$fg[cyan]%}%n%{$reset_color%} \
+%{$fg[white]%}at \
+%{$fg[green]%}$(box_name) \
+%{$fg[white]%}in \
+%{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\
+${git_info} \
+%{$fg[white]%}[%*]
+%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"
+fi