From 6acf7f8d3ec689f1f38c19a54a73b46f13ad1db6 Mon Sep 17 00:00:00 2001 From: Martin Gondermann Date: Tue, 25 Mar 2014 20:25:31 +0100 Subject: [PATCH] Wrapped prompt colors in \[ and \] to fix history. Should fix #45 --- git-prompt-colors.sh | 14 +++++++------- git-prompt-help.sh | 4 ++-- gitprompt.sh | 38 +++++++++++++++++++------------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/git-prompt-colors.sh b/git-prompt-colors.sh index 686804c..7eedc7e 100644 --- a/git-prompt-colors.sh +++ b/git-prompt-colors.sh @@ -3,11 +3,11 @@ GIT_PROMPT_SUFFIX="]" # the end of the git info string GIT_PROMPT_SEPARATOR="|" # separates each item - GIT_PROMPT_BRANCH="${Magenta}" # the git branch that is active in the current directory - GIT_PROMPT_STAGED="${Red}●" # the number of staged files/directories - GIT_PROMPT_CONFLICTS="${Red}✖" # the number of files in conflict - GIT_PROMPT_CHANGED="${Blue}✚" # the number of changed files + GIT_PROMPT_BRANCH="\[${Magenta}\]" # the git branch that is active in the current directory + GIT_PROMPT_STAGED="\[${Red}\]●" # the number of staged files/directories + GIT_PROMPT_CONFLICTS="\[${Red}\]✖" # the number of files in conflict + GIT_PROMPT_CHANGED="\[${Blue}\]✚" # the number of changed files GIT_PROMPT_REMOTE=" " # the remote branch name (if any) - GIT_PROMPT_UNTRACKED="${Cyan}…" # the number of untracked files/dirs - GIT_PROMPT_STASHED="${BoldBlue}⚑" # the number of stashed files/dir - GIT_PROMPT_CLEAN="${BoldGreen}✔" # a colored flag indicating a "clean" repo + GIT_PROMPT_UNTRACKED="\[${Cyan}\]…" # the number of untracked files/dirs + GIT_PROMPT_STASHED="\[${BoldBlue}\]⚑" # the number of stashed files/dir + GIT_PROMPT_CLEAN="\[${BoldGreen}\]✔" # a colored flag indicating a "clean" repo diff --git a/git-prompt-help.sh b/git-prompt-help.sh index ca6c5de..5d91595 100644 --- a/git-prompt-help.sh +++ b/git-prompt-help.sh @@ -3,7 +3,7 @@ # being displayed. git_prompt_help() { - cat <|] BRANCH is a branch name, such as "master" or "stage", a tag name, or commit @@ -32,7 +32,7 @@ EOF help_git_prompt() { git_prompt_help ; } git_prompt_examples() { - cat <