High-level libtmux operations — server/session/pane lifecycle.
Topology: One tmux session named 'hive' (configurable). Each ling gets its own window (full-width, not a split).
All operations are synchronous (<10ms) — no asyncio needed.
High-level libtmux operations — server/session/pane lifecycle. Topology: One tmux session named 'hive' (configurable). Each ling gets its own window (full-width, not a split). All operations are synchronous (<10ms) — no asyncio needed.
tmux -L socket name every operation here targets; nil is the default server. e2e tests bind a private one, so they can never reach the server an operator runs.
tmux -L socket name every operation here targets; nil is the default server. e2e tests bind a private one, so they can never reach the server an operator runs.
(capture-output pane)(capture-output pane {:keys [lines] :or {lines 50}})Capture the current pane content (last N lines).
Arguments: pane - libtmux pane object opts - {:lines int} (default 50)
Returns: Vector of strings (lines).
Capture the current pane content (last N lines).
Arguments:
pane - libtmux pane object
opts - {:lines int} (default 50)
Returns:
Vector of strings (lines).(create-pane! {:keys [ling-id cwd session-name]
:or {session-name default-session-name}})Create a new window with a pane for a ling. Each ling gets its own window (full-width).
Arguments: opts - {:ling-id str, :cwd str, :session-name str}
Returns: {:pane-id str, :window-id str, :pane obj, :window obj}
Create a new window with a pane for a ling.
Each ling gets its own window (full-width).
Arguments:
opts - {:ling-id str, :cwd str, :session-name str}
Returns:
{:pane-id str, :window-id str, :pane obj, :window obj}(ensure-server!)Connect to the tmux server *socket-name* names. Cached per socket name.
Returns the libtmux Server object or throws with actionable message.
Connect to the tmux server `*socket-name*` names. Cached per socket name. Returns the libtmux Server object or throws with actionable message.
(ensure-session!)(ensure-session! {:keys [session-name] :or {session-name default-session-name}})Get or create the hive tmux session.
Falls back to tmux new-session -d shell command when libtmux's
new_session fails (e.g. 'not a terminal' in headless/nREPL contexts).
Returns the session object.
Get or create the hive tmux session. Falls back to `tmux new-session -d` shell command when libtmux's new_session fails (e.g. 'not a terminal' in headless/nREPL contexts). Returns the session object.
(kill-pane! pane)Kill a tmux pane (and its window if it's the only pane).
Arguments: pane - libtmux pane object
Kill a tmux pane (and its window if it's the only pane). Arguments: pane - libtmux pane object
(pane-alive? pane-id)Check if a pane still exists on the tmux server.
Arguments: pane-id - string pane id (e.g. "%42")
Returns: true if pane exists, false otherwise.
Check if a pane still exists on the tmux server. Arguments: pane-id - string pane id (e.g. "%42") Returns: true if pane exists, false otherwise.
(reset-server!)Clear cached server. For testing.
Clear cached server. For testing.
(send-bracketed-paste! pane text)(send-bracketed-paste! pane text opts)(send-bracketed-paste! pane
text
{:keys [enter?] :or {enter? true}}
{:keys [call attr]})Paste one literal CLI input frame, preserving LF, then submit one Enter. Requires a bracketed-paste-aware CLI (the self-steer Codex/Claude targets). Uses an owned temporary file/buffer; generic keyboard sending is unchanged.
Paste one literal CLI input frame, preserving LF, then submit one Enter. Requires a bracketed-paste-aware CLI (the self-steer Codex/Claude targets). Uses an owned temporary file/buffer; generic keyboard sending is unchanged.
(send-interrupt! pane)Send C-c interrupt to a tmux pane.
Arguments: pane - libtmux pane object
Send C-c interrupt to a tmux pane. Arguments: pane - libtmux pane object
(send-keys! pane text)(send-keys! pane text opts)(send-keys! pane
text
{:keys [enter? literal?] :or {enter? true literal? true}}
{:keys [call attr]})Send text literally; libtmux submits Enter separately. opts: :enter? and :literal? both default true. The final arity accepts transport operations for isolated adapters/tests.
Send text literally; libtmux submits Enter separately. opts: :enter? and :literal? both default true. The final arity accepts transport operations for isolated adapters/tests.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |