send_keys
Send commands or key sequences to a tmux pane and capture the output. Supports raw key sequences like C-c or arrow keys when used with enter=false.
Instructions
Send keys or a command to a tmux pane, then capture its output. Target format: 'session:window.pane'. Use enter=false for raw tmux key sequences like 'C-c', 'Escape', or arrow keys — these are not shell commands and must not have Enter appended. Use enter=true (default) for shell commands. Set wait_ms higher for long-running commands; 0 captures immediately before output appears. WARNING: this executes arbitrary commands in your shell — only use with trusted input.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | Yes | Command or key sequence (tmux notation: 'C-c', 'Escape', 'Up', etc.) | |
| enter | No | Press Enter after keys (default: true). Set false for raw key sequences like C-c, Escape, arrow keys. | |
| target | Yes | Pane target: 'session:window.pane' | |
| wait_ms | No | Milliseconds to wait before capturing (default: 400). Set higher for slow commands, 0 to capture immediately. | |
| capture_lines | No | Lines to capture after sending (default: 50) |