Versions in this module Expand all Collapse all v0 v0.1.0 Aug 24, 2026 Changes in this version + const SubscribeAllPanes + const SubscribeAllWindows + const SubscribeSession + var ErrClosed = fmt.Errorf("gotmucks: control client closed: %w", ErrServerExited) + var ErrInvalidID = errors.New("gotmucks: not a tmux identifier") + var ErrNoPane = errors.New("gotmucks: pane not found") + var ErrNoServer = errors.New("gotmucks: no tmux server running") + var ErrNoSession = errors.New("gotmucks: session not found") + var ErrNoWindow = errors.New("gotmucks: window not found") + var ErrServerExited = errors.New("gotmucks: control connection exited") + var ErrUnsupportedVersion = errors.New("gotmucks: tmux version too old") + var Global = GlobalTarget + func Line(n int) *int + func SubscribePane(id PaneID) string + func SubscribeWindow(id WindowID) string + type CaptureOptions struct + End *int + Escapes bool + FullHistory bool + Join bool + PreserveTrailingSpaces bool + Start *int + type Client struct + func New(opts ...Option) *Client + func (c *Client) Binary() string + func (c *Client) CapturePane(ctx context.Context, id PaneID, opts CaptureOptions) ([]byte, error) + func (c *Client) CheckVersion(ctx context.Context) error + func (c *Client) HasSession(ctx context.Context, id SessionID) (bool, error) + func (c *Client) KillServer(ctx context.Context) error + func (c *Client) KillSession(ctx context.Context, id SessionID) error + func (c *Client) ListPanes(ctx context.Context) ([]Pane, error) + func (c *Client) ListSessionPanes(ctx context.Context, id SessionID) ([]Pane, error) + func (c *Client) ListSessionWindows(ctx context.Context, id SessionID) ([]Window, error) + func (c *Client) ListSessions(ctx context.Context) ([]Session, error) + func (c *Client) ListWindowPanes(ctx context.Context, id WindowID) ([]Pane, error) + func (c *Client) ListWindows(ctx context.Context) ([]Window, error) + func (c *Client) NewSession(ctx context.Context, opts NewSessionOptions) (*Session, error) + func (c *Client) Pane(ctx context.Context, id PaneID) (*Pane, error) + func (c *Client) Query(ctx context.Context, cmd string, spec FormatSpec) ([]Row, error) + func (c *Client) QueryArgs(ctx context.Context, spec FormatSpec, args ...string) ([]Row, error) + func (c *Client) RenameSession(ctx context.Context, id SessionID, name string) error + func (c *Client) RenameWindow(ctx context.Context, id WindowID, name string) error + func (c *Client) SendKeys(ctx context.Context, id PaneID, keys ...Key) error + func (c *Client) SendLine(ctx context.Context, id PaneID, s string) error + func (c *Client) SendText(ctx context.Context, id PaneID, s string) error + func (c *Client) ServerRunning(ctx context.Context) (bool, error) + func (c *Client) Session(ctx context.Context, id SessionID) (*Session, error) + func (c *Client) SetGlobalHook(ctx context.Context, name, command string) error + func (c *Client) SetHook(ctx context.Context, t Target, name, command string) error + func (c *Client) SetOption(ctx context.Context, t Target, name, value string) error + func (c *Client) SetOptionScoped(ctx context.Context, t Target, scope OptionScope, name, value string) error + func (c *Client) SetRemainOnExit(ctx context.Context, t Target, on bool) error + func (c *Client) ShowGlobalHooks(ctx context.Context) (map[string]string, error) + func (c *Client) ShowHooks(ctx context.Context, t Target) (map[string]string, error) + func (c *Client) ShowOption(ctx context.Context, t Target, scope OptionScope, name string) (string, bool, error) + func (c *Client) ShowOptions(ctx context.Context, t Target, scope OptionScope) (map[string]string, error) + func (c *Client) SocketArgs() []string + func (c *Client) UnsetGlobalHook(ctx context.Context, name string) error + func (c *Client) UnsetHook(ctx context.Context, t Target, name string) error + func (c *Client) UnsetOption(ctx context.Context, t Target, scope OptionScope, name string) error + func (c *Client) Version(ctx context.Context) (Version, error) + func (c *Client) Window(ctx context.Context, id WindowID) (*Window, error) + type ClientDetached struct + Client string + type ClientSessionChanged struct + Client string + Name string + Session SessionID + type ConfigError struct + Text string + type ControlClient struct + func Connect(ctx context.Context, opts ...Option) (*ControlClient, error) + func (cc *ControlClient) AttachedSession() SessionID + func (cc *ControlClient) Close() error + func (cc *ControlClient) Do(ctx context.Context, cmd string) (Reply, error) + func (cc *ControlClient) DoArgs(ctx context.Context, args ...string) (Reply, error) + func (cc *ControlClient) Done() <-chan struct{} + func (cc *ControlClient) Dropped() uint64 + func (cc *ControlClient) DroppedOutput(pane PaneID) uint64 + func (cc *ControlClient) Err() error + func (cc *ControlClient) Events() <-chan Event + func (cc *ControlClient) Output(pane PaneID) (<-chan []byte, error) + func (cc *ControlClient) Pause(ctx context.Context, pane PaneID) error + func (cc *ControlClient) PauseAfter(ctx context.Context, d time.Duration) error + func (cc *ControlClient) Resume(ctx context.Context, pane PaneID) error + func (cc *ControlClient) SetSize(ctx context.Context, cols, rows int) error + func (cc *ControlClient) Stderr() string + func (cc *ControlClient) Subscribe(ctx context.Context, name, target, format string) error + func (cc *ControlClient) Unsubscribe(ctx context.Context, name string) error + func (cc *ControlClient) Untap(pane PaneID) + func (cc *ControlClient) Version() Version + func (cc *ControlClient) Wait(ctx context.Context) error + type ControlError struct + Command string + Message string + Number int + func (e *ControlError) Error() string + type Event interface + type EventsDropped struct + Count uint64 + type ExitError struct + Args []string + Code int + Err error + Stderr string + func (e *ExitError) Error() string + func (e *ExitError) Unwrap() error + type Exited struct + Err error + Reason string + func (e Exited) String() string + type FormatSpec []string + func (s FormatSpec) Arg() string + type GlobalTarget struct + func (GlobalTarget) TargetArg() string + type Key struct + func Bytes(b []byte) Key + func Enter() Key + func Hex(b ...byte) Key + func Literal(s string) Key + func Named(name string) Key + func (k Key) String() string + type LayoutChanged struct + Flags string + Layout string + Visible string + Window WindowID + type Message struct + Text string + type NewSessionOptions struct + Command []string + Env map[string]string + Height int + Name string + StartDir string + Width int + WindowName string + type Option func(*config) + func WithAttach(id SessionID) Option + func WithBinary(path string) Option + func WithCloseTimeout(d time.Duration) Option + func WithControlArgs(args ...string) Option + func WithDoubleControlMode() Option + func WithEnv(env ...string) Option + func WithEventBuffer(n int) Option + func WithOutputBuffer(n int) Option + func WithSocketName(name string) Option + func WithSocketPath(path string) Option + func WithoutParentEnv() Option + func WithoutVersionCheck() Option + type OptionScope int + const ScopeGlobal + const ScopeGlobalWindow + const ScopePane + const ScopeServer + const ScopeSession + const ScopeWindow + func (s OptionScope) String() string + type OutputDropped struct + Count uint64 + Pane PaneID + type Pane struct + Active bool + CurrentCommand string + CurrentPath string + Dead bool + Height int + ID PaneID + Index int + PID int + Session SessionID + Title string + Width int + Window WindowID + type PaneContinued struct + Pane PaneID + type PaneID string + func ParsePaneID(s string) (PaneID, error) + func (id PaneID) Ordinal() (int, error) + func (id PaneID) String() string + func (id PaneID) TargetArg() string + func (id PaneID) Valid() bool + type PaneModeChanged struct + Pane PaneID + type PaneOutput struct + Age time.Duration + Data []byte + Extended bool + Pane PaneID + func (e PaneOutput) String() string + type PanePaused struct + Pane PaneID + type PasteBufferChanged struct + Buffer string + type PasteBufferDeleted struct + Buffer string + type ProtocolError struct + Line string + Reason string + func (e *ProtocolError) Error() string + type Reply struct + Flags int + Number int + Output []string + Time time.Time + func (r Reply) Rows(spec FormatSpec) ([]Row, error) + func (r Reply) String() string + type Row struct + func ParseRows(spec FormatSpec, lines []string) ([]Row, error) + func (r Row) At(i int) string + func (r Row) Bool(name string) (bool, error) + func (r Row) Get(name string) string + func (r Row) Int(name string) (int, error) + func (r Row) Len() int + func (r Row) Lookup(name string) (string, bool) + func (r Row) Map() map[string]string + func (r Row) PaneID(name string) (PaneID, error) + func (r Row) SessionID(name string) (SessionID, error) + func (r Row) Time(name string) (time.Time, error) + func (r Row) WindowID(name string) (WindowID, error) + type Session struct + Activity time.Time + Attached int + Created time.Time + ID SessionID + Name string + Windows int + func (s Session) IsAttached() bool + type SessionChanged struct + Name string + Session SessionID + type SessionID string + func ParseSessionID(s string) (SessionID, error) + func (id SessionID) Ordinal() (int, error) + func (id SessionID) String() string + func (id SessionID) TargetArg() string + func (id SessionID) Valid() bool + type SessionRenamed struct + Name string + Session SessionID + type SessionWindowChanged struct + Session SessionID + Window WindowID + type SessionsChanged struct + type SubscriptionChanged struct + Name string + Pane PaneID + Session SessionID + Value string + Window WindowID + WindowIndex int + type Target interface + TargetArg func() string + type UnknownNotification struct + Args string + Name string + type Version struct + Major int + Minor int + Next bool + Raw string + Suffix string + Unknown bool + func MinimumVersion() Version + func ParseVersion(s string) (Version, error) + func (v Version) AtLeast(w Version) bool + func (v Version) Compare(w Version) int + func (v Version) EscapesDollarOnWrite() bool + func (v Version) String() string + type Window struct + Active bool + Height int + ID WindowID + Index int + Layout string + Name string + Panes int + Session SessionID + Width int + type WindowAdded struct + Window WindowID + type WindowClosed struct + Window WindowID + type WindowID string + func ParseWindowID(s string) (WindowID, error) + func (id WindowID) Ordinal() (int, error) + func (id WindowID) String() string + func (id WindowID) TargetArg() string + func (id WindowID) Valid() bool + type WindowPaneChanged struct + Pane PaneID + Window WindowID + type WindowRenamed struct + Name string + Window WindowID