PTYProcess
PTYProcess is a test subprocess that owns an isolated controlling terminal and a memory-backed transcript. It comes from StartPTYProcess. Output may be read concurrently through PTYProcess.Output; writes are serialized.
Source and package
- Qualified name
-
tmuxtest.PTYProcess - Package
- tmuxtest
- Distribution
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/tmuxtest/pty_process.go
Members6#
- Close method Close stops the subprocess if needed and releases the PTY master. It is safe to call concurrently and more than once.
- CloseContext method CloseContext starts an idempotent shutdown and waits within ctx. Concurrent calls join the same shutdown. If ctx ends after shutdown starts, shutdown continues and a later call may wait for completion; an already-ended ctx does not start shutdown.
- Done method Done is closed when the subprocess exits. It can close before the terminal reader has added the final bytes to
PTYProcess.Output. - Output method Output returns a fresh copy of terminal output collected so far. A successful
PTYProcess.Waitguarantees that the returned transcript includes the final drain. - Wait method Wait waits for process completion and the final output drain, or ctx cancellation. A successful Wait guarantees that
PTYProcess.Outputcontains the completed transcript. - Write method Write sends terminal input to the subprocess within ctx. Writes are serialized and can be partial. A waiting caller may cancel before acquiring the writer, and an active write observes ctx cancellation.