From 2eb0f2b9b3d5cee9d0e66fb8b4102f32f20c1582 Mon Sep 17 00:00:00 2001 From: tw93 Date: Thu, 26 Feb 2026 19:42:58 +0800 Subject: [PATCH] fix(log): generate summary divider width from terminal width Replace hardcoded 70-char string with a dynamically generated divider capped at terminal width (max 70) so the separator fits narrow terminals instead of overflowing them. --- lib/core/log.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/core/log.sh b/lib/core/log.sh index 797b92f..95d92ce 100644 --- a/lib/core/log.sh +++ b/lib/core/log.sh @@ -363,7 +363,12 @@ print_summary_block() { fi done - local divider="======================================================================" + local _tw + _tw=$(tput cols 2> /dev/null || echo 70) + [[ "$_tw" =~ ^[0-9]+$ ]] || _tw=70 + [[ $_tw -gt 70 ]] && _tw=70 + local divider + divider=$(printf '%*s' "$_tw" '' | tr ' ' '=') # Print with dividers echo ""