Skip to content

Commit 24b6132

Browse files
felipecgitster
authored andcommitted
prompt: fix untracked files for zsh
We signal presense of untracked files by adding a per-cent sign '%' to the prompt. But because '%' is used as an escape character to introduce prompt customization in zsh (just like bash prompt uses '\' to escape '\u', '\h', etc.), we need to say '%%' to get a literal per-cent. Helped-by: Andreas Schwab <[email protected]> Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 845241d commit 24b6132

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/completion/git-prompt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ __git_ps1 ()
338338
[ "$(git config --bool bash.showUntrackedFiles)" != "false" ] &&
339339
[ -n "$(git ls-files --others --exclude-standard)" ]
340340
then
341-
u="%"
341+
u="%${ZSH_VERSION+%}"
342342
fi
343343

344344
if [ -n "${GIT_PS1_SHOWUPSTREAM-}" ]; then

0 commit comments

Comments
 (0)