# send_keys

Source: https://libtmux.org/en/rs/latest/mcp/tools/send_keys/

> 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. Send input to a pane's program; a shell that receives it runs it with your user's permissions.

MCP is in development

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

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](https://libtmux.org/en/rs/latest/mcp/tools/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](https://libtmux.org/en/rs/latest/mcp/tools/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.

[All Rust tools](../) · [JSON](../send_keys.json) · [Source](https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/tmux-mcp/src/tools/control.rs#L356)

## Arguments

* `enter` optional · boolean

  Whether to press Enter afterwards.

  Default: `false`.

* `keys` optional · array | 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-c\` to interrupt, \`Escape\`, \`Up\`, \`C-d\`. Sending \`C-c\` as \`text\` would type those three characters. Omit to press none.

* `pane` required · string

  The \`%\`-prefixed pane id.

* `text` optional · string | null

  Text typed literally into the pane. Key names are not interpreted. Omit to type none.

## Schemas

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