MCPconceptAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

mcp.src.TmuxTools.wait_for_text

#[tool_router(router = observe_router, vis = "pub(super)")] impl TmuxTools #[tool( description = "Wait until a pane writes matching text. On tmux 3.7 or newer it reads the \ pane's live output stream, so text that scrolls past between checks is \ still seen, and the returned text is that raw stream, not the rendered \ screen: a line redrawn in place repeats. Below 3.7 it polls the \ visible screen about every 120 ms and misses text that appears and \ scrolls off between two reads. capture_pane shows the screen. Prefer \ run_shell_command for commands you are sending yourself: it reports an \ exit status instead of guessing from output. Use this for output you did \ not author, such as a server logging that it is ready. A line this server \ itself types and submits -- with send_keys, paste_text, or \ run_shell_command's own dispatch -- is discounted from a match for a \ short time afterward, so waiting for text you just sent does not match \ its own echo; output that happens to repeat the same words still does. A \ submitted line that wrapped across terminal rows is discounted as one line. \ A pattern still on the row being typed into, not yet \ submitted, reports outcome pending instead of matched, and one already on \ a completed row before this call attached reports present_at_entry. A \ pane or server that ends reports pane_closed; an observer stream that \ drops while the pane lives reports stream_lost. \ On 3.7 or newer, waiting owns an observer client until the wait \ ends. Each list accepts at most 32 patterns, each at most 4,096 \ bytes, using Rust's linear-time regex engine.", title = "Wait For Pane Text", meta = crate::capability_meta!( Inspect, None, effects = [Observe], outputs = [TmuxMetadata, TerminalContent], secrets = true, untrusted = true, sinks = { "pane" => [TmuxLookup], "patterns" => [Regex], "stop" => [Regex], "regex" => [None], "match_case" => [None], "seconds" => [None] }, literalized = [], nested = [], self_bounded = true, always_load = false, ) )] pub async fn wait_for_text( &self, Parameters(WaitForTextArgs { pane, patterns, stop, regex, match_case, seconds, }): Parameters<WaitForTextArgs>, cancelled: tokio_util::sync::CancellationToken, reporter: Reporter, ) -> Result<Json<WaitView>, ToolError>

Wait until a pane writes something a caller is looking for.

Esc

Type to search.

Reference previewOpen reference