send_control
Send control keys or escape sequences to running commands for interrupts, TUI navigation, or non-printable input. Avoids stripping of raw control bytes common in AI frameworks.
Instructions
Send a control key or escape sequence to a running command. Use for
interrupts (ctrl+c), TUI navigation (arrows, F-keys), or any
non-printable input. Prefer this over `respond` for control keys —
AI frameworks strip raw control bytes from string arguments.
SIGNAL HANDLING: The signal parameter accepts any key name from the
supported list (case-insensitive, whitespace-tolerant — "Ctrl + C"
works). Common signals: ctrl+c (SIGINT/interrupt), ctrl+z (SIGTSTP/
suspend), ctrl+d (EOF), ctrl+\ (SIGQUIT). Local non-PTY subprocesses
only react to ctrl+c, ctrl+z, ctrl+\; SSH and PTY channels accept all.
SIDE EFFECTS: The signal may terminate the command (e.g. ctrl+c),
making the command_id invalid on the next read.
TIMEOUT INTERACTION: pause_timeout controls how long to wait for
output after the signal. Raise it for slow TUI repaints over
high-latency SSH; total_timeout only binds during active streaming.
ERRORS: Raises ValueError if command_id is invalid, already completed,
or signal name is unrecognized.
RETURNS: Same format as execute —
{"status": "completed"|"partial", "output": str, ...}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| signal | Yes | Case-insensitive key name. Values: ctrl+a..ctrl+z, ctrl+[/]/^/_/\, esc, tab, enter, return, space, backspace, up/down/left/right, home, end, pageup, pagedown, insert, delete, f1..f12, backtab, alt+<char>. Raises ValueError if unrecognized | |
| command_id | Yes | The command_id from a status='partial' response. Must be an active command. Raises ValueError if invalid or already completed | |
| pause_timeout | No | Seconds of output silence after sending the key before returning. Raise for slow TUI repaints (e.g. over high-latency SSH). Must be > 0 and ≤ total_timeout | |
| total_timeout | No | Hard cap on total call duration in seconds. Only binds while output is actively streaming. Must be ≥ pause_timeout |