From 3ce8bf1482dde9a6411ed17be356314c0d53c92b Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Tue, 8 Mar 2022 15:37:32 +0000 Subject: [PATCH] fix: MacOS PTY flake when reading after command exists The TTY wasn't bufferring properly because the FD was closed. I did this initially to clone how creack/pty handles it, but it's unnecessary because we get the entire PTY back to close. --- pty/start_other.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pty/start_other.go b/pty/start_other.go index 6709cb271b1e4..a527869e99178 100644 --- a/pty/start_other.go +++ b/pty/start_other.go @@ -17,9 +17,6 @@ func startPty(cmd *exec.Cmd) (PTY, *os.Process, error) { if err != nil { return nil, nil, xerrors.Errorf("open: %w", err) } - defer func() { - _ = tty.Close() - }() cmd.SysProcAttr = &syscall.SysProcAttr{ Setsid: true, Setctty: true,