# send_keys

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

> Send keys (commands or text) to a tmux pane.

MCP is in development

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

Send keys (commands or text) to a tmux pane.

Use this for raw interactive input: TUI keys, control sequences, partial shell input, or persistent shell state. Use [`send_keys_batch`](https://libtmux.org/en/py/latest/mcp/tools/send_keys_batch/) when you need several ordered raw-input operations.

For authored shell commands that need completion, exit status, or captured output, use [`run_command`](https://libtmux.org/en/py/latest/mcp/tools/run_command/) instead. For custom completion outside that shape, compose `tmux wait-for -S <channel>` into the shell command and call [`wait_for_channel`](https://libtmux.org/en/py/latest/mcp/tools/wait_for_channel/). For repeated observation after input, prefer [`capture_since`](https://libtmux.org/en/py/latest/mcp/tools/capture_since/); reserve [`wait_for_text`](https://libtmux.org/en/py/latest/mcp/tools/wait_for_text/) for output the agent does not author.

Do NOT call [`capture_pane`](https://libtmux.org/en/py/latest/mcp/tools/capture_pane/) immediately — both the read and the pattern-match paths race the pane’s PTY draw.

[All Python tools](../) · [JSON](../send_keys.json) · [Source](https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/pane_tools/__init__.py#L82)

## Arguments

* `enter` optional · boolean

  Whether to press Enter after sending keys. Default True.

  Default: `true`.

* `keys` required · string

  The keys or text to send.

* `literal` optional · boolean

  Whether to send keys literally (no tmux interpretation). Default False.

  Default: `false`.

* `pane_id` optional

  Pane ID (e.g. '%1').

  Default: `null`.

* `session_id` optional

  Session ID (e.g. '$1') for pane resolution.

  Default: `null`.

* `session_name` optional

  Session name for pane resolution.

  Default: `null`.

* `socket_name` optional

  tmux socket name.

  Default: `null`.

* `suppress_history` optional · boolean

  Suppress shell history by prepending a space; only effective where the shell ignores space-prefixed commands. Default False.

  Default: `false`.

* `window_id` optional

  Window ID for pane resolution.

  Default: `null`.

## Schemas

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