Skip to content

Commit aa31387

Browse files
committed
cleanup TUI lines after switching to "compact" mode
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent d47f0f3 commit aa31387

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/progress/tty.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func (w *ttyWriter) printTailEvents() {
118118
}
119119
}
120120

121-
func (w *ttyWriter) print() {
121+
func (w *ttyWriter) print() { //nolint:gocyclo
122122
w.mtx.Lock()
123123
defer w.mtx.Unlock()
124124
if len(w.eventIDs) == 0 {
@@ -182,7 +182,12 @@ func (w *ttyWriter) print() {
182182
}
183183
}
184184
}
185-
185+
for i := numLines; i < w.numLines; i++ {
186+
if numLines < goterm.Height()-2 {
187+
fmt.Fprintln(w.out, strings.Repeat(" ", terminalWidth))
188+
numLines++
189+
}
190+
}
186191
w.numLines = numLines
187192
}
188193

0 commit comments

Comments
 (0)