Send keys¶
send_keys¶
Send keys (commands or text) to a tmux pane.
- Returns:
Use when you need to type raw input, press keys, or interact with
a terminal program. For several ordered raw-input operations, use
send_keys_batch.
Avoid when you need to run one authored shell command and
immediately capture its result — use run_command so exit
status, timeout state, and output come back as one typed result. For
output the agent does not author, use wait_for_text or
observe with capture_since.
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 |
|
Suppress shell history by prepending a space; only effective where the shell ignores space-prefixed commands. Default False. |
|
|
no |
— |
tmux socket name. |