From fa9f33a5deff8d2ce63baa84719b7a273a142914 Mon Sep 17 00:00:00 2001 From: Dan Anglin Date: Mon, 17 Jun 2024 10:29:37 +0100 Subject: [PATCH] set min term width --- internal/printer/printer.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/printer/printer.go b/internal/printer/printer.go index c466fc9..a71e8ce 100644 --- a/internal/printer/printer.go +++ b/internal/printer/printer.go @@ -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,