Skip to content

Commit 4d8d073

Browse files
authored
progress: adjust terminal size only when output is stdout (#375)
1 parent b2249da commit 4d8d073

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

progress/progress.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,11 @@ func (p *Progress) initForRender() {
353353
p.updateFrequency = DefaultUpdateFrequency
354354
}
355355

356-
// get the current terminal size for preventing roll-overs, and do this in a
357-
// background loop until end of render
358-
go p.watchTerminalSize() // needs p.updateFrequency
356+
if p.outputWriter == os.Stdout {
357+
// get the current terminal size for preventing roll-overs, and do this in a
358+
// background loop until end of render. This only works if the output writer is STDOUT.
359+
go p.watchTerminalSize() // needs p.updateFrequency
360+
}
359361
}
360362

361363
func (p *Progress) updateTerminalSize() {

0 commit comments

Comments
 (0)