From 69a09624c95751739c908e750cbc0359fd4e34b2 Mon Sep 17 00:00:00 2001 From: Laura Brehm Date: Thu, 12 Jan 2023 01:22:58 +0100 Subject: [PATCH] Skip child events when printer events > terminal height Signed-off-by: Laura Brehm --- pkg/progress/tty.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/progress/tty.go b/pkg/progress/tty.go index 8729571aef..dc8ebf83fb 100644 --- a/pkg/progress/tty.go +++ b/pkg/progress/tty.go @@ -157,6 +157,10 @@ func (w *ttyWriter) print() { } } + skipChildEvents := false + if len(w.eventIDs) > goterm.Height()-1 { + skipChildEvents = true + } numLines := 0 for _, v := range w.eventIDs { event := w.events[v] @@ -169,6 +173,9 @@ func (w *ttyWriter) print() { for _, v := range w.eventIDs { ev := w.events[v] if ev.ParentID == event.ID { + if skipChildEvents { + continue + } line := lineText(ev, " ", terminalWidth, statusPadding, runtime.GOOS != "windows") fmt.Fprint(w.out, line) numLines++