# libtmux_mcp.tools.pane_tools.send_keys

- **Module:** libtmux_mcp.tools.pane_tools
- **Package:** libtmux-mcp
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/pane_tools/io.py#L102
- **Page:** https://libtmux.org/en/py/latest/mcp/reference/libtmux_mcp-tools-pane_tools-send_keys/

```
libtmux_mcp.tools.pane_tools.send_keys(keys: str, pane_id: str | None = None, session_name: str | None = None, session_id: str | None = None, window_id: str | None = None, enter: bool = True, literal: bool = False, suppress_history: bool = False, socket_name: str | None = None) -> str
```

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``
when you need several ordered raw-input operations.

For authored shell commands that need completion, exit status, or
captured output, use ``run_command`` instead. For custom completion
outside that shape, compose ``tmux wait-for -S <channel>`` into the
shell command and call ``wait_for_channel``. For repeated observation
after input, prefer ``capture_since``; reserve ``wait_for_text``
for output the agent does not author.

Do NOT call ``capture_pane`` immediately — both the read and the
pattern-match paths race the pane's PTY draw.

## Parameters

- `keys` (str): The keys or text to send.
- `pane_id` (str | None): Pane ID (e.g. '%1').
- `session_name` (str | None): Session name for pane resolution.
- `session_id` (str | None): Session ID (e.g. '$1') for pane resolution.
- `window_id` (str | None): Window ID for pane resolution.
- `enter` (bool): Whether to press Enter after sending keys. Default True.
- `literal` (bool): Whether to send keys literally (no tmux interpretation). Default False.
- `suppress_history` (bool): Suppress shell history by prepending a space; only effective where
the shell ignores space-prefixed commands. Default False.
- `socket_name` (str | None): tmux socket name.

## Returns

str
    Confirmation message.
