terminal_send
Send commands to terminal windows by focusing the window, typing text, and pressing Enter. Use clipboard paste for IME-safe text entry and restore focus to the previous window after sending.
Instructions
Send a command to a terminal window (Windows Terminal, conhost, PowerShell, cmd, WSL). Wraps focus_window + keyboard type + Enter. preferClipboard=true (default) uses clipboard paste — IME-safe for CJK text, but overwrites the user's clipboard. restoreFocus=true (default) returns focus to the previously active window after sending. Caveats: If the terminal is busy (previous command still running), text will be injected mid-stream — check terminal_read first or use wait_until(terminal_output_contains) to confirm completion before sending.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| windowTitle | Yes | Partial title of the terminal window. | |
| input | Yes | Text to send (max 10,000 chars). | |
| pressEnter | No | Press Enter after typing (default true). | |
| focusFirst | No | Focus the terminal before sending (default true). | |
| restoreFocus | No | Restore the previously-focused window after sending (default true). | |
| preferClipboard | No | Use clipboard paste (typeViaClipboard) — IME/long-text safe (default true). | |
| pasteKey | No | Paste key combo. 'auto' picks ctrl+shift+v for WSL/bash/mintty/wezterm/alacritty, ctrl+v elsewhere. Only used when preferClipboard=true. | auto |
| forceFocus | No | When true, bypass Windows foreground-stealing protection via AttachThreadInput before focusing the terminal window. Default: follows env DESKTOP_TOUCH_FORCE_FOCUS (default false). | |
| trackFocus | No | When true (default), detect if focus was stolen after sending. Reports focusLost in the response. | |
| settleMs | No | Milliseconds to wait after sending before checking foreground window (default 300). |