From 3153b6a24de879f36960a27857f23f4e3a5633a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Fri, 5 Jun 2026 22:41:51 +0200 Subject: [PATCH] fix: auto-detect terminal color support instead of forcing it FORCE_COLOR defaulted to 1, emitting ANSI codes unconditionally. On SSH sessions without a proper TTY or with TERM=dumb this caused color codes to render text invisible. Now colors are enabled only when stdout is an interactive terminal; FORCE_COLOR=1 can still override when needed. Co-Authored-By: Claude Sonnet 4.6 --- scripts/arty.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/arty.sh b/scripts/arty.sh index 56e3a3c1..c2f62616 100755 --- a/scripts/arty.sh +++ b/scripts/arty.sh @@ -16,8 +16,12 @@ WHIP_CONFIG="${WHIP_CONFIG:-arty.yml}" WHIP_HOOKS_DIR=".whip/hooks" WHIP_CHANGELOG="${WHIP_CHANGELOG:-CHANGELOG.md}" -# Colors for output - only use colors if output is to a terminal or if FORCE_COLOR is set -export FORCE_COLOR=${FORCE_COLOR:-"1"} +# Enable colors only when stdout is a real terminal (or FORCE_COLOR=1 overrides) +if [[ -t 1 && "${TERM:-}" != "dumb" ]]; then + export FORCE_COLOR=${FORCE_COLOR:-"1"} +else + export FORCE_COLOR=${FORCE_COLOR:-"0"} +fi if [[ "$FORCE_COLOR" = "0" ]]; then export RED='' export GREEN=''