Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

struct libtmux-go latest

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
struct tmuxtest.PTYProcess

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.Wait guarantees 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.Output contains 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.
Esc

Type to search.

Reference previewOpen reference