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.
(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 running tmux server. Cached singleton. Returns the libtmux Server object or throws with actionable message.
Connect to the running tmux server. Cached singleton. 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-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 {:keys [enter?] :or {enter? true}})Send keys to a tmux pane.
Arguments: pane - libtmux pane object text - string to send opts - {:enter? bool} (default true — press Enter after text)
Send keys to a tmux pane.
Arguments:
pane - libtmux pane object
text - string to send
opts - {:enter? bool} (default true — press Enter after text)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 |