Expand description
tmux session management for batty.
Wraps tmux CLI commands for session lifecycle, output capture via pipe-pane, input injection via send-keys, and pane management. This replaces the portable-pty direct approach from Phase 1 with tmux-based supervision.
Structs§
- Pane
Details - Metadata for a tmux pane.
- Test
Session - RAII guard that kills a tmux session on drop.
- Tmux
Capabilities - tmux capability probe result used by orchestrator startup.
Enums§
- Split
Mode - Known split strategies for creating the orchestrator log pane.
Constants§
- SUPERVISOR_
PAUSE_ HOTKEY - Default tmux-prefix hotkey for pausing Batty supervision.
- SUPERVISOR_
RESUME_ HOTKEY - Default tmux-prefix hotkey for resuming Batty supervision.
Functions§
- attach
- Attach to an existing tmux session (blocks until detach/exit).
- capture_
pane - Capture the current visible content of a tmux target (session or pane).
- capture_
pane_ recent - Capture only the most recent visible lines of a tmux target.
- check_
tmux - Check that tmux is installed and reachable.
- configure_
supervisor_ hotkeys - Configure per-session supervisor hotkeys:
- create_
session - Create a detached tmux session running the given command.
- create_
window - Create a detached tmux window in an existing session running the given command.
- kill_
pane - Kill a specific tmux pane.
- kill_
session - Kill a tmux session.
- list_
pane_ details - List panes in a session with command/active/dead metadata.
- list_
sessions_ with_ prefix - List all tmux session names matching a prefix.
- load_
buffer - Load text into a named tmux paste buffer.
- pane_
current_ path - Get the current working directory for a pane target.
- pane_
dead - Check whether a pane target is dead (
remain-on-exitpane). - pane_
dimensions - Return
(pane_width, pane_height)for a tmux pane target. - pane_
exists - Check if a specific tmux pane target exists.
- pane_id
- Get the active pane id for a session target (for example:
%3). - pane_
pipe_ enabled - Check whether a pane currently has an active
pipe-panecommand. - paste_
buffer - Paste the named batty buffer into a target pane and delete the buffer.
- probe_
capabilities - Probe tmux capabilities used by Batty and choose compatible behavior.
- rename_
window - Rename an existing tmux window target (e.g.
session:0orsession:old). - respawn_
pane - Respawn a dead pane with a new command.
- select_
layout_ even - Evenly spread a pane and any adjacent panes in its layout cell.
- select_
window - Select a tmux window target (e.g.
session:agent-1). - send_
keys - Send keys to a tmux target (session or pane).
- session_
exists - Check if a tmux session exists.
- session_
name - Convention for session names:
batty-<phase>. - session_
path - Get the configured session working directory path.
- set_
mouse - Enable/disable tmux mouse mode for a session.
- setup_
pipe_ pane - Set up pipe-pane to capture all output from the target pane to a log file.
- setup_
pipe_ pane_ if_ missing - Set up pipe-pane only if none is configured yet (
tmux pipe-pane -o). - split_
window_ horizontal - Helper: run
tmux set -t <session> <option> <value>. Split a pane horizontally (creates a new pane to the right). - split_
window_ vertical_ in_ pane - Split a specific pane vertically (creates a new pane below).
- take_
supervisor_ hotkey_ action - Read and clear a queued supervisor hotkey action for the session.
- tmux_
available - Return whether the tmux binary is available in the current environment.
- tmux_
set - Helper: run
tmux set -t <session> <option> <value>.