From 3884b1fdf423f4e8655dd47bef0ccb2ebdd68c6d Mon Sep 17 00:00:00 2001 From: Michael Allen Date: Sat, 5 Sep 2015 10:50:47 +0100 Subject: Fix colour issue for zsh --- prompt.bash | 2 +- prompt.zsh | 2 +- radar-base.sh | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/prompt.bash b/prompt.bash index 604d8e1..264ea7b 100755 --- a/prompt.bash +++ b/prompt.bash @@ -10,7 +10,7 @@ if is_repo; then if show_remote_status $args; then bash_color_remote_commits fi - readable_branch_name + bash_readable_branch_name bash_color_local_commits printf "\x01\033[1;30m\x02)\x01\033[0m\x02" bash_color_changes_status diff --git a/prompt.zsh b/prompt.zsh index e996b77..5a7cb40 100755 --- a/prompt.zsh +++ b/prompt.zsh @@ -12,7 +12,7 @@ if is_repo; then if show_remote_status $args; then zsh_color_remote_commits fi - readable_branch_name + zsh_readable_branch_name zsh_color_local_commits printf '%s' "%{$fg_bold[black]%})%{$reset_color%}" zsh_color_changes_status diff --git a/radar-base.sh b/radar-base.sh index c793eab..2ad9ce7 100755 --- a/radar-base.sh +++ b/radar-base.sh @@ -180,7 +180,13 @@ branch_ref() { fi } -readable_branch_name() { +zsh_readable_branch_name() { + if is_repo; then + printf '%s' "$COLOR_BRANCH$(branch_name || printf '%s' "detached@$(commit_short_sha)")$RESET_COLOR_BRANCH" + fi +} + +bash_readable_branch_name() { if is_repo; then printf "$COLOR_BRANCH$(branch_name || printf '%s' "detached@$(commit_short_sha)")$RESET_COLOR_BRANCH" fi -- cgit v1.2.3