set min term width

This commit is contained in:
Dan Anglin 2024-06-17 10:29:37 +01:00
parent ed2d941259
commit fa9f33a5de
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638

View file

@ -12,6 +12,10 @@ import (
"time"
)
const (
minTerminalWidth = 40
)
type theme struct {
reset string
boldblue string
@ -49,6 +53,10 @@ func NewPrinter(
grey: "\033[90m",
}
if maxTerminalWidth < minTerminalWidth {
maxTerminalWidth = minTerminalWidth
}
return &Printer{
noColor: noColor,
maxTerminalWidth: maxTerminalWidth,