summaryrefslogtreecommitdiffstats
path: root/prompt.bash
diff options
context:
space:
mode:
authorMichael Allen <michael@michaelallen.io>2015-08-19 09:49:20 +0100
committerMichael Allen <michael@michaelallen.io>2015-08-19 09:49:25 +0100
commitd5dbddf68c45dfff380d6e6767de401054024a19 (patch)
tree3ee24532344bd8d70340010c10de4537f5e696eb /prompt.bash
parent5bfe5141cce192b17d1327809126048ec6dc622c (diff)
downloadgit-sonar-d5dbddf68c45dfff380d6e6767de401054024a19.tar.gz
git-sonar-d5dbddf68c45dfff380d6e6767de401054024a19.zip
Remove unnecessary subshells from bash prompt
In the zsh prompt we need to use '%s' on the printf to prevent the `${fg_bold[<color>]}` expressions from expanding before the colors have been loaded in. In the bash prompt this is unnecessary as the \\033 codes are base control characters, and so have no dependency they rely on.
Diffstat (limited to 'prompt.bash')
-rwxr-xr-xprompt.bash11
1 files changed, 8 insertions, 3 deletions
diff --git a/prompt.bash b/prompt.bash
index 410989c..e39a1b1 100755
--- a/prompt.bash
+++ b/prompt.bash
@@ -4,7 +4,12 @@ dot="$(cd "$(dirname "$0")"; pwd)"
source "$dot/git-base.sh"
if is_repo; then
- git_prefix="\033[1;30mgit:(\033[0m"
- git_suffix="\033[1;30m)\033[0m"
- printf " $git_prefix$(bash_color_remote_commits;readable_branch_name;bash_color_local_commits)$git_suffix$(bash_color_changes_status)"
+ printf " \033[1;30mgit:(\033[0m"
+ bash_color_remote_commits
+ printf "\033[0;37m"
+ readable_branch_name
+ printf "\033[0m"
+ bash_color_local_commits
+ printf "\033[1;30m)\033[0m"
+ bash_color_changes_status
fi