mirror of
https://github.com/tw93/Mole.git
synced 2026-03-22 20:50:06 +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:
@@ -363,7 +363,12 @@ print_summary_block() {
|
|||||||
fi
|
fi
|
||||||
done
|
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
|
# Print with dividers
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
Reference in New Issue
Block a user