From 5f7783846a05d23448a3b8d12429259b5552023e 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 b329d245546..fbaf5281877 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 }