fix: don't check terminal size if we're not writing to a terminal

This commit is contained in:
Christian Muehlhaeuser
2022-02-14 21:57:59 +01:00
committed by Christian Rocha
parent 6301f93cb2
commit 2296184dc5

2
tea.go
View File

@@ -439,7 +439,7 @@ func (p *Program) StartReturningModel() (Model, error) {
defer close(readLoopDone)
}
if f, ok := p.output.(*os.File); ok {
if f, ok := p.output.(*os.File); ok && isatty.IsTerminal(f.Fd()) {
// Get the initial terminal size and send it to the program.
go func() {
w, h, err := term.GetSize(int(f.Fd()))