tmux

How AgentBox uses tmux for detachable box sessions and where attached agents open — splits, windows, and the Ctrl+a chords

tmux is the portable backbone of AgentBox's terminal integration: it works the same on macOS and Linux, and it's what makes box sessions detachable. If TMUX is set, AgentBox uses tmux for placement even when it's nested inside another multiplexer like cmux — its CLI is the right primitive and is portable everywhere.

Detachable sessions

agentbox shell and the agent commands run inside a tmux session, so closing the terminal — or detaching on purpose — never kills the box. Ctrl+a d detaches without stopping the agent; reattach later:

# attach the agent session
agentbox claude mybox

# Ctrl+a d to detach, then resume it later
agentbox claude attach mybox

# the same for a plain shell
agentbox shell attach mybox

The tmux wrapping is controlled by the shell.tmux config key (default true). A one-shot agentbox shell mybox -- <cmd> is never tmux-wrapped, so stdout stays clean for scripts.

Where the session opens

The attach.openIn config key (CLI flag --attach-in) decides where an attached session lands. Under tmux:

ModeWhat happens
split (default)tmux split-window in the current window
tabNew tmux window
windowNew tmux window
sameInline in the current pane (no spawn) — same as --inline
# open the agent session in a new tmux window, just this once
agentbox claude mybox --attach-in tab

# inline in the current pane
agentbox claude mybox --inline

The Ctrl+a chords

While attached, Ctrl+a opens a which-key menu in the footer; press a single key to act on the box. These shell out to the same commands in Access your box.

KeysWhat it does
Ctrl+a cOpen the box in VS Code / Cursor
Ctrl+a sOpen the box's live screen (noVNC)
Ctrl+a uOpen the box's web app URL
Ctrl+a tOpen a fresh shell in the same box — a new tmux window
Ctrl+a kDestroy the box (after a confirmation)
Ctrl+a dDetach the session (keeps running)

A literal Ctrl+a still reaches the session — press it twice (Ctrl+a Ctrl+a). For juggling many detached boxes at once, see Background and parallel.

On this page