# wait_for_text

Source: https://libtmux.org/en/ts/latest/mcp/tools/wait_for_text/

> Read pane output; accepts no client-supplied executable input. Returned content may be sensitive or untrusted. Wait until a pane prints something, streaming tmux's notifications rather than polling. Use for output you did NOT author — another process, a person, a background job. For a command you wrote, use run_shell_command: it knows when the command ended and reports exit status, which no text match can. This discounts text this server itself typed into the pane, for as long as it is unsubmitted or was submitted within the last ten seconds, so a command you just sent cannot match its own echo — but a pane not yet reading input can still echo type-ahead back once it starts, so wait for a prompt before typing into a cold shell. Whatever happens you get back what the pane printed and why the wait ended — a timeout is never an empty answer.

MCP is in development

Server behavior and tool contracts may change. Tool availability depends on the server configuration.

Read pane output; accepts no client-supplied executable input. Returned content may be sensitive or untrusted. Wait until a pane prints something, streaming tmux’s notifications rather than polling. Use for output you did NOT author — another process, a person, a background job. For a command you wrote, use [run\_shell\_command](https://libtmux.org/en/ts/latest/mcp/tools/run_shell_command/): it knows when the command ended and reports exit status, which no text match can. This discounts text this server itself typed into the pane, for as long as it is unsubmitted or was submitted within the last ten seconds, so a command you just sent cannot match its own echo — but a pane not yet reading input can still echo type-ahead back once it starts, so wait for a prompt before typing into a cold shell. Whatever happens you get back what the pane printed and why the wait ended — a timeout is never an empty answer.

[All TypeScript tools](../) · [JSON](../wait_for_text.json) · [Source](https://github.com/libtmux/libtmux-ts/blob/3fe1ca654b81b8cbf4a13b777a001a3298c87a6f/packages/mcp/src/tools/wait.ts#L503)

## Arguments

* `cursor` optional · string

  Start from a cursor an earlier capture\_since or wait returned.

* `maxLines` optional · integer

  Keep at most this many lines, from the end. Defaults to the server limit.

* `paneId` required · string

  Stable pane id, e.g. %1.

* `patterns` optional · array

  Any one of these ends the wait. Omit to wait for any output at all.

* `regex` optional · boolean

  Interpret patterns using libtmux's bounded regular-expression grammar.

* `timeoutMs` optional · integer

  Clamped by the server ceiling; the result reports what was used.

## Schemas

The schema defines required fields, nested values, defaults, and validation constraints.
