1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 21:55:08 +00:00

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.
This commit is contained in:
tw93
2026-02-26 19:42:58 +08:00
parent 6c0aa87389
commit 2eb0f2b9b3

View File

@@ -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 ""