fix: MacOS PTY flake when reading after command exists (#410)

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.
This commit is contained in:
Kyle Carberry
2022-03-08 09:49:09 -06:00
committed by GitHub
parent ca768e7e83
commit 6caceacfb4
-3
View File
@@ -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,