From d97cdde38dfaf8d7f63d5f86eb9eac4eab359dc4 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 21 Mar 2019 21:07:49 -0400 Subject: Skip writes if term is closed --- widgets/terminal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'widgets') diff --git a/widgets/terminal.go b/widgets/terminal.go index d8170235..5b0be1aa 100644 --- a/widgets/terminal.go +++ b/widgets/terminal.go @@ -120,7 +120,7 @@ func NewTerminal(cmd *exec.Cmd) (*Terminal, error) { buf := make([]byte, 4096) for { n, err := term.pty.Read(buf) - if err != nil { + if err != nil || term.closed { // These are generally benine errors when the process exits term.Close(nil) return -- cgit