Send keys

send_keys

send_keys
mutating tool
mutating tool
send_keys

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

Returns:

str

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

keys

str

yes

The keys or text to send.

pane_id

str

no

Pane ID (e.g. ‘%1’).

session_name

str

no

Session name for pane resolution.

session_id

str

no

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

window_id

str

no

Window ID for pane resolution.

enter

bool

no

True

Whether to press Enter after sending keys. Default True.

literal

bool

no

False

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

suppress_history

bool

no

False

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

socket_name

str

no

tmux socket name.