git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] prompt: fix tracked files for zsh
@ 2013-04-21  8:11 Felipe Contreras
  2013-04-21  8:21 ` Andreas Schwab
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Felipe Contreras @ 2013-04-21  8:11 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Felipe Contreras

When this option is enabled, the prompt gets totally screwed in zsh
because all the codes start with % in zsh (like they are \ in bas). So
we need to escape the % character.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/completion/git-prompt.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index 756a951..4bedbcc 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@ -340,7 +340,11 @@ __git_ps1 ()
 			   [ "$(git config --bool bash.showUntrackedFiles)" != "false" ] &&
 			   [ -n "$(git ls-files --others --exclude-standard)" ]
 			then
-				u="%"
+				if [ -n "${ZSH_VERSION-}" ]; then
+					u="%%"
+				else
+					u="%"
+				fi
 			fi
 
 			if [ -n "${GIT_PS1_SHOWUPSTREAM-}" ]; then
-- 
1.8.2.1.790.g4588561

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-04-21 22:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-21  8:11 [PATCH] prompt: fix tracked files for zsh Felipe Contreras
2013-04-21  8:21 ` Andreas Schwab
2013-04-21  8:48   ` Junio C Hamano
2013-04-21 19:02     ` Andreas Schwab
2013-04-21 21:00       ` Felipe Contreras
2013-04-21 22:00         ` Junio C Hamano
2013-04-21 22:32           ` Felipe Contreras
2013-04-21  8:43 ` Eric Sunshine
2013-04-21  8:43 ` Junio C Hamano
2013-04-21  8:43 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).