From 68345d5d9f340b0dc6270a7dbad292ec20a907aa 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 b883fe81b7..f5af6ad060 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()))