From a2a53a7095ff9e80d8422161961ec76cda5587bb Mon Sep 17 00:00:00 2001 From: Yuriy Mayatnikov Date: Sat, 31 Jan 2026 15:17:36 +0300 Subject: [PATCH] Fix ANSI escape codes not rendering in log output Use $'...' (ANSI-C quoting) instead of '...' for color variables so they contain real escape bytes. Fixes raw \033[1m appearing in output when color codes are passed through printf %s arguments. Co-Authored-By: Claude Opus 4.5 --- setup.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/setup.sh b/setup.sh index 23820d8..9ddcc13 100755 --- a/setup.sh +++ b/setup.sh @@ -18,12 +18,12 @@ CHECK_ONLY=false # ── Colors ───────────────────────────────────────────────────────────────── if [[ -t 1 ]]; then - RED='\033[0;31m' - GREEN='\033[0;32m' - YELLOW='\033[0;33m' - CYAN='\033[0;36m' - BOLD='\033[1m' - RESET='\033[0m' + RED=$'\033[0;31m' + GREEN=$'\033[0;32m' + YELLOW=$'\033[0;33m' + CYAN=$'\033[0;36m' + BOLD=$'\033[1m' + RESET=$'\033[0m' else RED='' GREEN='' YELLOW='' CYAN='' BOLD='' RESET='' fi @@ -281,7 +281,7 @@ main() { old_qdisc=$(get_current_qdisc) if show_status; then - log_info "${GREEN}BBR is already enabled. Nothing to do.${RESET}" + log_info "BBR is already enabled. Nothing to do." print_summary "$old_cc" "$old_qdisc" "$old_cc" "$old_qdisc" exit 0 fi @@ -321,7 +321,7 @@ main() { new_qdisc=$(get_current_qdisc) print_summary "$old_cc" "$old_qdisc" "$new_cc" "$new_qdisc" "$backup_path" - log_info "${GREEN}${BOLD}Done.${RESET}" + log_info "Done." } main "$@"