On this page
tmuxtest.ControlMode
- Module
- tmuxtest
- Package
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/tmuxtest/control.go
-
ControlMode is an attached tmux control client for real-tmux tests. It owns one stdout reader and a temporary-file spool, which preserves unread protocol output until
ControlMode.Closereleases it. Instances come fromNewControlMode; do not construct them directly or read concurrently.
7 declared, 0 inherited
Members
- ClientName method ClientName returns the tmux-assigned identity captured at registration.
- Close method Close stops the control client and releases its output spool. 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.
- Read method Read reads control-protocol output within ctx. Exactly one caller may read at a time. After the client exits, callers may drain preserved output through
io.EOF; afterControlMode.Close, a non-empty Read returnsos.ErrClosed. It returns ctx errors while waiting for output. - Server method Server returns the validated server handle captured at construction.
- Session method Session returns the validated session handle captured at construction.
- Wait method Wait blocks until the control client exits or ctx ends. It does not stop or close the client; use
ControlMode.Closeto release it.