testPTY is a pipe-based PTY implementation for in-process CLI testing on Windows. ConPTY requires an attached process to function correctly - without one, the pipe handles become invalid intermittently. This implementation avoids ConPTY entirely for the ptytest.New() + Attach() use case.
| 16 | // one, the pipe handles become invalid intermittently. This implementation |
| 17 | // avoids ConPTY entirely for the ptytest.New() + Attach() use case. |
| 18 | type testPTY struct { |
| 19 | inputReader *os.File |
| 20 | inputWriter *os.File |
| 21 | outputReader *os.File |
| 22 | outputWriter *os.File |
| 23 | |
| 24 | closeMutex sync.Mutex |
| 25 | closed bool |
| 26 | } |
| 27 | |
| 28 | func newTestPTY(_ ...pty.Option) (pty.PTY, error) { |
| 29 | p := &testPTY{} |
nothing calls this directly
no outgoing calls
no test coverage detected