浏览代码

gitfast: fix the prompt colour

We can add colour in Zsh without the need of pcmode.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Felipe Contreras 9 年之前
父节点
当前提交
079fef48df
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      plugins/gitfast/git-prompt.sh

+ 5 - 3
plugins/gitfast/git-prompt.sh

@@ -502,9 +502,11 @@ __git_ps1 ()
 
 	local z="${GIT_PS1_STATESEPARATOR-" "}"
 
-	# NO color option unless in PROMPT_COMMAND mode
-	if [ $pcmode = yes ] && [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
-		__git_ps1_colorize_gitstring
+	# NO color option unless in PROMPT_COMMAND mode or it's Zsh
+	if [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
+		if [ $pcmode = yes ] || [ -n "${ZSH_VERSION-}" ]; then
+			__git_ps1_colorize_gitstring
+		fi
 	fi
 
 	b=${b##refs/heads/}