From 2296184dc573adb5579da27464c59e17c162c23a Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Mon, 14 Feb 2022 21:57:59 +0100 Subject: [PATCH] fix: don't check terminal size if we're not writing to a terminal --- tea.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tea.go b/tea.go index b883fe8..f5af6ad 100644 --- a/tea.go +++ b/tea.go @@ -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()))