libtmux_mcp.tools.pane_tools.wait_for_text
Python
- Python
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust Unavailable
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- libtmux_mcp.tools.pane_tools.wait_for_textWaitForTextResult
( 12 parameters )
-
Wait for NEW output in a tmux pane, then return.
Polls until one of
patternsappears on a line written *after* this call starts, one ofstopappears (immediate failure exit), or the timeout expires. Passpatterns=nullto wait for any new output at all. Use this instead of pollingcapture_panein a loop.Pre-existing scrollback is never matched, and neither is paint left below the cursor at entry — only rows written after the call began count. If a pattern was already on screen the result says so via
matched_at_entry.Last resort: reserve for output you did not author. Commands you send are AUTHORED — use
run_command(returns exit status) or compose; tmux wait-for -S <channel>withwait_for_channelinstead, both cheaper and exact. For unattributable recurring prompts or background log lines, bracket your own command with a unique sentinel (cmd; echo __WAIT_$RANDOM__) and wait for that.stopis the cheap way to avoid burning the whole budget: pass the failure markers you already know ("error:","FAILED","Traceback") and a failed run returns in milliseconds instead of at the ceiling.The server caps
timeout. An over-large value is not an error — the wait returns at the ceiling and reportseffective_timeout.- Parameters
-
-
patterns ( list[str] | None ) – Success patterns; the first one to match ends the wait. Literal text unless
regex=True. Omit or passnullto wait for any new output. -
stop ( list[str] | None ) – Failure patterns. A hit ends the wait immediately with
outcome="stopped"andfound=false;matched_indexsays which entry fired. -
regex ( bool ) – Interpret
patternsandstopas regular expressions. Default False (literal text). -
session_name ( str | None ) – Session name for pane resolution.
-
session_id ( str | None ) – Session ID (e.g. '$1') for pane resolution.
-
timeout ( float ) – Requested seconds to wait. Default 8.0. Clamped by server policy; see
effective_timeoutin the result. -
interval ( float ) – Seconds between polls. Default 0.05 (50ms). Minimum 0.01.
-
match_case ( bool ) – Whether to match case. Default False (case-insensitive).
-
ctx ( Context | None ) – FastMCP context; when injected the tool reports progress to the client. Omitted in tests.
-
- Returns
-
WaitForTextResult Match outcome, a bounded tail of what the pane printed, and the timeout actually enforced.
Discussed in Python MCP examples , Python MCP topics