From 736fe7ecf49112583489f74d3fb2d3beeb358486 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Fri, 24 Feb 2023 22:41:09 -0300 Subject: [PATCH] don't use "bright black" ANSI for logging unless we're running under a known-good terminal (eg, iTerm2) - giving up on the "bright black" == "gray" thing. There's enough bad default themes out there, and not the first time people (rightfully) complained... --- lib/functions/logging/logging.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/functions/logging/logging.sh b/lib/functions/logging/logging.sh index 26e756224f..e017e0f3d4 100644 --- a/lib/functions/logging/logging.sh +++ b/lib/functions/logging/logging.sh @@ -28,11 +28,11 @@ function logging_init() { declare -g bright_yellow_color="\e[1;33m" yellow_color="\e[0;33m" declare -g ansi_reset_color="\e[0m" declare -g -i logging_section_counter=0 # -i: integer - declare -g tool_color="${gray_color}" # default to gray... (should be ok on terminals) + declare -g tool_color="${normal_color}" # default to normal color. - # @TODO: more terminals might have a bit... impaired... default themes. correct. - if [[ "${TERM}" == "alacritty" ]]; then - declare -g tool_color="${normal_color}" + # A few terminals, like iTerm2, are known to correctly display "bright black" as gray. Use that if available. + if [[ "${ITERM_SHELL_INTEGRATION_INSTALLED:-"No"}" == "Yes" ]]; then + declare -g tool_color="${gray_color}" fi if [[ "${CI}" == "true" ]]; then # ... but that is too dark for Github Actions