Wait for text¶
wait_for_text¶
wait_for_textWait for text to appear in a tmux pane.
- Returns:
Use when you need to block until specific output appears — waiting for a server to start, a build to complete, or a prompt to return.
Avoid when the expected text may never appear — always set a reasonable
timeout. For known output, capture_pane after a known delay
may suffice, but wait_for_text is preferred because it adapts to variable
timing.
Side effects: None. Readonly. Blocks until text appears or timeout.
Example:
{
"tool": "wait_for_text",
"arguments": {
"pattern": "Server listening",
"pane_id": "%2",
"timeout": 30
}
}
Response:
{
"found": true,
"matched_lines": [
"Server listening on port 8000"
],
"pane_id": "%2",
"elapsed_seconds": 0.002,
"timed_out": false
}
Parameters
Parameter |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
yes |
— |
Text to wait for. Treated as literal text by default. Set |
|
|
no |
|
Whether to interpret pattern as a regular expression. Default False (literal text matching). |
|
|
no |
— |
Pane ID (e.g. ‘%1’). |
|
|
no |
— |
Session name for pane resolution. |
|
|
no |
— |
Session ID (e.g. ‘$1’) for pane resolution. |
|
|
no |
— |
Window ID for pane resolution. |
|
|
no |
|
Maximum seconds to wait. Default 8.0. |
|
|
no |
|
Seconds between polls. Default 0.05 (50ms). |
|
|
no |
|
Whether to match case. Default False (case-insensitive). |
|
|
no |
— |
Start line for capture. Negative values reach into scrollback. |
|
|
no |
— |
End line for capture. |
|
|
no |
— |
tmux socket name. |
|
|
Context |
no |
— |
FastMCP context; when injected the tool reports progress to the client. Omitted in tests. |