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.send_keys

#[tool_router(router = control_router, vis = "pub(super)")] impl TmuxTools #[tool( description = "Type text into a pane, press named keys in it, or both. `text` is sent \ literally, so C-c in it types those three characters. Use `keys` for \ anything without a character of its own -- C-c to interrupt a running \ command, Escape, Up, C-d -- which are tmux key names and are \ interpreted. Text, keys, and optional Enter keep that order in one tmux \ dispatch. Before input, the configured synchronized-pane cohort is \ observed; a dead, \ input-disabled, mode-owned, terminal-attended, or inherited-caller member \ refuses the whole call, and so does an active run_shell_command, except \ for keys C-c or C-\\ sent alone, which interrupt it. Returned pane IDs \ describe configured membership, not confirmed delivery. The \ observation can race with tmux processing the input. A submitted line is \ remembered briefly so wait_for_text can discount its own echo; an \ unrecognized key stops that for the pane's current line rather than mask \ it inaccurately.", title = "Send Keys To Pane", meta = crate::capability_meta!(Execute, PaneInput, [Change], [TmuxMetadata], true, true, { "pane" => [TmuxLookup], "text" => [PaneInput], "keys" => [PaneInput], "enter" => [PaneInput] }) )] pub async fn send_keys( &self, Parameters(args): Parameters<SendKeysArgs>, ) -> Result<Json<Sent>, ToolError>

Type text into a pane, or press keys in it.

Guides#

Pages that discuss send_keys.

Esc

Type to search.

Reference previewOpen reference