From 67b2f6ed2528620153abb6658030d89c699b86dc Mon Sep 17 00:00:00 2001 From: ray Date: Tue, 30 Sep 2025 20:28:56 +0100 Subject: [PATCH] refactor prompt colors for improved visibility Updated color definitions in bashrc and gitstatus-custom.sh to enhance clarity of the prompt display, using bright white for branch names and modified/untracked statuses. --- bashrc | 1 - gitstatus-custom.sh | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bashrc b/bashrc index c7991c9..0667594 100644 --- a/bashrc +++ b/bashrc @@ -15,7 +15,6 @@ _NC='\033[0m' # Get the current day of the week, day of the month, and year *) day_suffix="th";; esac - # Determine the color based on the classification # No Color / Reset _RED='\033[0;31m' # Red _GREEN='\033[01;32m' # Bright Green _YELLOW='\033[0;33m' # Yellow diff --git a/gitstatus-custom.sh b/gitstatus-custom.sh index 2c46cda..2a3a66f 100644 --- a/gitstatus-custom.sh +++ b/gitstatus-custom.sh @@ -13,7 +13,7 @@ function my_gitstatus_prompt_update() { [[ "$VCS_STATUS_RESULT" == ok-sync ]] || return 0 # not a git repo local reset=$'\001\e[0m\002' # no color - local green=$'\001\e[38;5;076m\002' # green - clean branch name only + local bright_white=$'\001\e[1;37m\002' # bright white - branch name and modified/untracked local red=$'\001\e[38;5;196m\002' # red - urgent attention (conflicts, merge) local p @@ -32,7 +32,7 @@ function my_gitstatus_prompt_update() { # Truncate long branch names and tags (( ${#where} > 32 )) && where="${where:0:12}…${where: -12}" - p+="${green}${where}" + p+="${bright_white}${where}" # Remote tracking status (no color - less distracting) (( VCS_STATUS_COMMITS_BEHIND )) && p+=" ${reset}behind:${VCS_STATUS_COMMITS_BEHIND}" @@ -51,8 +51,8 @@ function my_gitstatus_prompt_update() { [[ -n "$VCS_STATUS_ACTION" ]] && p+=" ${red}${VCS_STATUS_ACTION}" (( VCS_STATUS_NUM_CONFLICTED )) && p+=" ${red}conflicts:${VCS_STATUS_NUM_CONFLICTED}" (( VCS_STATUS_NUM_STAGED )) && p+=" ${reset}staged:${VCS_STATUS_NUM_STAGED}" - (( VCS_STATUS_NUM_UNSTAGED )) && p+=" ${reset}modified:${VCS_STATUS_NUM_UNSTAGED}" - (( VCS_STATUS_NUM_UNTRACKED )) && p+=" ${reset}untracked:${VCS_STATUS_NUM_UNTRACKED}" + (( VCS_STATUS_NUM_UNSTAGED )) && p+=" ${bright_white}modified:${VCS_STATUS_NUM_UNSTAGED}" + (( VCS_STATUS_NUM_UNTRACKED )) && p+=" ${bright_white}untracked:${VCS_STATUS_NUM_UNTRACKED}" GITSTATUS_PROMPT="${p}${reset}" }