Send keys

send_keys

send_keys
mutating tool

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

Returns:

str

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

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

Whether to suppress shell history by prepending a space. Only works in shells that support HISTCONTROL. Default False.

socket_name

str

no

tmux socket name.