@@ -47,11 +47,11 @@ channel is signalled — strictly cheaper in agent turns than a
4747
4848** Sample render** (`` command="pytest" `` , `` pane_id="%1" `` ):
4949
50- ```` text
50+ ```` markdown
5151Run this shell command in tmux pane %1 and block
5252until it finishes, preserving the command's exit status:
5353
54- ```
54+ ``` python
5555send_keys(
5656 pane_id = ' %1' ,
5757 keys = ' pytest; __mcp_status=$?; tmux wait-for -S libtmux_mcp_wait_<uuid>; exit $__mcp_status' ,
@@ -61,8 +61,8 @@ capture_pane(pane_id='%1', max_lines=100)
6161```
6262
6363After the channel signals, read the last ~ 100 lines to verify the
64- command's behaviour. Do NOT use a `` capture_pane` ` retry loop —
65- `` wait_for_channel` ` is strictly cheaper in agent turns.
64+ command's behaviour. Do NOT use a ` capture_pane ` retry loop —
65+ ` wait_for_channel ` is strictly cheaper in agent turns.
6666````
6767
6868The `` __mcp_status=$? `` capture and `` exit $__mcp_status `` mean the
@@ -91,12 +91,12 @@ the agent from acting before it has a hypothesis, which prevents
9191
9292** Sample render** (`` pane_id="%1" `` ):
9393
94- ``` text
94+ ``` markdown
9595Something went wrong in tmux pane %1. Diagnose it:
9696
97- 1. Call `` snapshot_pane(pane_id="%1")` ` to get content,
97+ 1 . Call ` snapshot_pane(pane_id="%1") ` to get content,
9898 cursor position, pane mode, and scroll state in one call.
99- 2. If the content looks truncated, re-call with `` max_lines=None` `.
99+ 2 . If the content looks truncated, re-call with ` max_lines=None ` .
1001003 . Identify the last command that ran (look at the prompt line and
101101 the line above it) and the last non-empty output line.
1021024 . Propose a root cause hypothesis and a minimal command to verify
@@ -130,36 +130,36 @@ override the OS-neutral default.
130130
131131** Sample render** (`` session_name="dev" `` ):
132132
133- ```` text
133+ ```` markdown
134134Set up a 3-pane development workspace named
135135'dev' with editor on top, a shell on the bottom-left, and
136136a logs tail on the bottom-right:
137137
138- 1. `` create_session(session_name="dev")` ` — creates the
138+ 1 . ` create_session(session_name="dev") ` — creates the
139139 session with a single pane (pane A, the editor). Capture the
140- returned `` active_pane_id`` as ``%A` `.
141- 2. `` split_window(pane_id="%A", direction="below")` ` — splits off
140+ returned ` active_pane_id ` as ` %A ` .
141+ 2 . ` split_window(pane_id="%A", direction="below") ` — splits off
142142 the bottom half (pane B, the terminal). Capture the returned
143- `` pane_id`` as ``%B` `.
144- 3. `` split_window(pane_id="%B", direction="right")` ` — splits pane B
143+ ` pane_id ` as ` %B ` .
144+ 3 . ` split_window(pane_id="%B", direction="right") ` — splits pane B
145145 horizontally (pane C, the logs pane). Capture the returned
146- `` pane_id`` as ``%C` `.
147- 4. Launch the editor and the log command via `` send_keys` `:
148- `` send_keys(pane_id="%A", keys="vim")` ` and
149- `` send_keys(pane_id="%C", keys='watch -n 1 date')` `. Leave pane B
146+ ` pane_id ` as ` %C ` .
147+ 4 . Launch the editor and the log command via ` send_keys ` :
148+ ` send_keys(pane_id="%A", keys="vim") ` and
149+ ` send_keys(pane_id="%C", keys='watch -n 1 date') ` . Leave pane B
150150 at its fresh shell prompt — nothing needs to be sent there. No
151151 pre-launch wait is required: tmux buffers keystrokes into the
152152 pane's PTY whether or not the shell has finished drawing, so
153- `` send_keys`` immediately after `` split_window` ` is safe and
153+ ` send_keys ` immediately after ` split_window ` is safe and
154154 shell-agnostic.
1551555 . Optionally confirm each program drew its UI via
156- `` wait_for_content_change(pane_id="%A", timeout=3.0)` `
157- (and similarly for ``%C` `). This is a "did the screen change?"
156+ ` wait_for_content_change(pane_id="%A", timeout=3.0) `
157+ (and similarly for ` %C ` ). This is a "did the screen change?"
158158 check — it works whether the pane shows a prompt glyph, a vim
159159 splash screen, or a log tail, so no shell-specific regex is
160160 needed.
161161
162- Use pane IDs (``%N` `) for all subsequent targeting — they are stable
162+ Use pane IDs (` %N ` ) for all subsequent targeting — they are stable
163163across layout changes; window renames are not.
164164````
165165
@@ -183,18 +183,18 @@ without operator consent — by drawing a clear escalation boundary.
183183
184184** Sample render** (`` pane_id="%1" `` ):
185185
186- ```` text
186+ ```` markdown
187187Interrupt whatever is running in pane %1 and
188188verify that control returns to the shell:
189189
190- 1. `` send_keys(pane_id="%1", keys="C-c", literal=False,
191- enter=False)`` — tmux interprets `` C-c` ` as SIGINT.
192- 2. `` wait_for_text(pane_id="%1", pattern="\$ |\# |\% ",
193- regex=True, timeout=5.0)`` — waits for a common shell prompt
190+ 1 . `send_keys(pane_id="%1", keys="C-c", literal=False,
191+ enter=False)` — tmux interprets ` C-c` as SIGINT.
192+ 2 . `wait_for_text(pane_id="%1", pattern="\$ |\# |\% ",
193+ regex=True, timeout=5.0)` — waits for a common shell prompt
194194 glyph. Adjust the pattern to match the user's shell theme.
1951953 . If the wait times out the process is ignoring SIGINT. Stop and
196196 ask the caller how to proceed — do NOT escalate automatically
197- to `` C-\`` (SIGQUIT) or `` kill` `.
197+ to ` C-\ ` (SIGQUIT) or ` kill ` .
198198````
199199
200200The shell-prompt regex covers default bash / zsh — adjust for fish
0 commit comments