浏览代码

Red prompt for remote hosts

James Smith 11 年之前
父节点
当前提交
00bff0a996
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      themes/intheloop.zsh-theme

+ 7 - 1
themes/intheloop.zsh-theme

@@ -3,10 +3,16 @@
 
 local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
 
+local host_color="green"
+if [ -n "$SSH_CLIENT" ]; then
+  local host_color="red"
+fi
+
 PROMPT='
-%{$fg_bold[grey]%}[%{$reset_color%}%{$fg_bold[green]%}%n@%m%{$reset_color%}%{$fg_bold[grey]%}]%{$reset_color%} %{$fg_bold[blue]%}%10c%{$reset_color%} $(git_prompt_info) $(git_remote_status)
+%{$fg_bold[grey]%}[%{$reset_color%}%{$fg_bold[${host_color}]%}%n@%m%{$reset_color%}%{$fg_bold[grey]%}]%{$reset_color%} %{$fg_bold[blue]%}%10c%{$reset_color%} $(git_prompt_info) $(git_remote_status)
 %{$fg_bold[cyan]%}❯%{$reset_color%} '
 
+
 RPROMPT='${return_status}%{$reset_color%}'
 
 ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[grey]%}(%{$fg[red]%}"