Wait for text

wait_for_text

wait_for_text
readonly tool
readonly tool
wait_for_text

Wait for NEW text to appear in a tmux pane.

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 repeated observation or tailing, use capture_since; for command completion you control, use wait_for_channel.

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,
  "risk_band_warned": false
}

risk_band_warned is true when polling entered tmux’s history-limit trim-risk band. In that state, matching remains best-effort because older scrollback can be discarded while the wait is active; use wait_for_channel for deterministic command completion.

Parameters

Parameter

Type

Required

Default

Description

pattern

str

yes

Text to wait for. Treated as literal text by default. Set regex=True to interpret as a regular expression.

regex

bool

no

False

Whether to interpret pattern as a regular expression. Default False (literal text matching).

pane_id

str

no

Pane ID (e.g. ‘%1’).

session_name

str

no

Session name for pane resolution.

session_id

str

no

Session ID (e.g. ‘$1’) for pane resolution.

window_id

str

no

Window ID for pane resolution.

timeout

float

no

8.0

Maximum seconds to wait. Default 8.0.

interval

float

no

0.05

Seconds between polls. Default 0.05 (50ms).

match_case

bool

no

False

Whether to match case. Default False (case-insensitive).

socket_name

str

no

tmux socket name.

ctx

Context

no

FastMCP context; when injected the tool reports progress to the client. Omitted in tests.