Skip to main content

Module tmux

Module tmux 

Source
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§

PaneDetails
Metadata for a tmux pane.
TestSession
RAII guard that kills a tmux session on drop.
TmuxCapabilities
tmux capability probe result used by orchestrator startup.

Enums§

SplitMode
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-exit pane).
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-pane command.
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:0 or session: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>.