send_keys
-
Type text into a pane, press named keys in it, or both.
textis sent literally, so C-c in it types those three characters. Usekeysfor 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. Send input to a pane’s program; a shell that receives it runs it with your user’s permissions.- MCP request method
tools/callSendsend_keysas the tool name, with the arguments below.
Arguments#
-
Whether to press Enter afterwards.
-
keys? (Array<string> | null) #tmux key names to press, in order, after any text.
These are interpreted rather than typed, which is the only way to send a key that has no character:
C-cto interrupt,Escape,Up,C-d. SendingC-castextwould type those three characters. Omit to press none. -
The
%-prefixed pane id. -
Text typed literally into the pane. Key names are not interpreted. Omit to type none.
No other arguments are accepted.
Result#
Returns object
Annotations#
destructiveHinttrueidempotentHintfalseopenWorldHinttruereadOnlyHintfalsetitle"Send Keys To Pane"
Protocol data#
Use the complete advertised contract for validation and client integration.
Input schema
{"$schema": "https://json-schema.org/draft/2020-12/schema","additionalProperties": false,"properties": {"enter": {"default": false,"description": "Whether to press Enter afterwards.","type": "boolean"},"keys": {"description": "tmux key names to press, in order, after any text.\n\nThese are interpreted rather than typed, which is the only way to send\na key that has no character: `C-c` to interrupt, `Escape`, `Up`,\n`C-d`. Sending `C-c` as `text` would type those three characters.\nOmit to press none.","items": {"type": "string"},"type": ["array","null"]},"pane": {"description": "The `%`-prefixed pane id.","type": "string"},"text": {"description": "Text typed literally into the pane. Key names are not interpreted. Omit\nto type none.","type": ["string","null"]}},"required": ["pane"],"type": "object"}Output schema
{"$schema": "https://json-schema.org/draft/2020-12/schema","properties": {"pane": {"description": "The pane the caller targeted.","type": "string"},"panes": {"description": "The effective configured recipient IDs observed before dispatch.\n\nMembership does not confirm delivery and may change after observation.","items": {"type": "string"},"type": "array"}},"required": ["pane","panes"],"type": "object"}