Skip to content

Commit

Permalink
cleanup TUI lines after switching to "compact" mode
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
  • Loading branch information
ndeloof committed Jan 25, 2023
1 parent d47f0f3 commit 5f77838
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/progress/tty.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 5f77838

Please sign in to comment.