Run several terminal inputs
terminal_batchSend a sequence of terminal inputs in a single call and get the screen once at the end, eliminating per-keystroke round trips when driving full-screen programs with known steps.
Instructions
Send a sequence of inputs in one call and get the screen back once at the end — for driving a full-screen program without a round trip per keystroke (open a menu, move down three, press Enter, type a name, confirm). Actions run in order, each given a moment to take effect before the next.
Each action is an object with a type and the fields that type uses:
type:text— typed as keystrokes; \n presses Enter.paste:text— delivered as one bracketed paste where the program supports it.press:key, optionalcount— same key specs as terminal_press.click:col,row— left click, sent immediately with no preview; needs the program to track the mouse.scroll:direction, optionalamount,col,row— as terminal_scroll.wait:msfor a fixed pause, orpattern(optionaltimeoutMs) to continue once a regex matches the screen.
The batch is validated before anything is sent. It stops at the first action that fails (a pattern that never appears, a click the program cannot receive, the process exiting) and reports how far it got, with the screen as it stands. Use it when you already know the steps; when you need to look between steps, use the individual tools.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| idleMs | No | Settle window after the last action. Default 200. | |
| actions | Yes | The inputs to send, in order (1 to 50). | |
| maxWaitMs | No | Cap on the settle after the last action. Default 5000. | |
| sessionId | Yes | Numeric id of the session to target. Get one by calling terminal_create. Use terminal_list to enumerate currently-known ids. | |
| stepIdleMs | No | How long output must be quiet after each action before the next is sent. Default 100. Raise it for programs that redraw slowly. |