Skip to content

Commit

Permalink
fix: don't check terminal size if we're not writing to a terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Feb 14, 2022
1 parent 6301f93 commit 68345d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tea.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down

0 comments on commit 68345d5

Please sign in to comment.