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=''