Skip to content

Commit

Permalink
Skip child events when printer events > terminal height
Browse files Browse the repository at this point in the history
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
  • Loading branch information
laurazard authored and ndeloof committed Jan 12, 2023
1 parent 4ad8746 commit 69a0962
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/progress/tty.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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++
Expand Down

0 comments on commit 69a0962

Please sign in to comment.