From aa3138735534af4477eb635f0b2ca67548594c91 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Wed, 25 Jan 2023 11:29:56 +0100 Subject: [PATCH] cleanup TUI lines after switching to "compact" mode Signed-off-by: Nicolas De Loof --- pkg/progress/tty.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/progress/tty.go b/pkg/progress/tty.go index b329d2455..a0792cd99 100644 --- a/pkg/progress/tty.go +++ b/pkg/progress/tty.go @@ -118,7 +118,7 @@ func (w *ttyWriter) printTailEvents() { } } -func (w *ttyWriter) print() { +func (w *ttyWriter) print() { //nolint:gocyclo w.mtx.Lock() defer w.mtx.Unlock() if len(w.eventIDs) == 0 { @@ -182,7 +182,12 @@ func (w *ttyWriter) print() { } } } - + for i := numLines; i < w.numLines; i++ { + if numLines < goterm.Height()-2 { + fmt.Fprintln(w.out, strings.Repeat(" ", terminalWidth)) + numLines++ + } + } w.numLines = numLines }