Skip to content

Commit 69a0962

Browse files
laurazardndeloof
authored andcommitted
Skip child events when printer events > terminal height
Signed-off-by: Laura Brehm <[email protected]>
1 parent 4ad8746 commit 69a0962

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/progress/tty.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ func (w *ttyWriter) print() {
157157
}
158158
}
159159

160+
skipChildEvents := false
161+
if len(w.eventIDs) > goterm.Height()-1 {
162+
skipChildEvents = true
163+
}
160164
numLines := 0
161165
for _, v := range w.eventIDs {
162166
event := w.events[v]
@@ -169,6 +173,9 @@ func (w *ttyWriter) print() {
169173
for _, v := range w.eventIDs {
170174
ev := w.events[v]
171175
if ev.ParentID == event.ID {
176+
if skipChildEvents {
177+
continue
178+
}
172179
line := lineText(ev, " ", terminalWidth, statusPadding, runtime.GOOS != "windows")
173180
fmt.Fprint(w.out, line)
174181
numLines++

0 commit comments

Comments
 (0)