Send keys¶
send_keys¶
send_keysSend keys (commands or text) to a tmux pane.
- Returns:
Use when you need to type commands, press keys, or interact with a terminal. This is the primary way to execute commands in tmux panes.
Avoid when you need to run something and immediately capture the result —
send keys first, then use capture_pane or wait_for_text.
Side effects: Sends keystrokes to the pane. If enter is true (default),
the command executes.
Example:
{
"tool": "send_keys",
"arguments": {
"keys": "npm start",
"pane_id": "%2"
}
}
Response (string):
Keys sent to pane %2
Parameters
Parameter |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
yes |
— |
The keys or text to send. |
|
|
no |
— |
Pane ID (e.g. ‘%1’). |
|
|
no |
— |
Session name for pane resolution. |
|
|
no |
— |
Session ID (e.g. ‘$1’) for pane resolution. |
|
|
no |
— |
Window ID for pane resolution. |
|
|
no |
|
Whether to press Enter after sending keys. Default True. |
|
|
no |
|
Whether to send keys literally (no tmux interpretation). Default False. |
|
|
no |
|
Whether to suppress shell history by prepending a space. Only works in shells that support HISTCONTROL. Default False. |
|
|
no |
— |
tmux socket name. |