User guide / MCP server

Terminal writes

Development reference · View source

With Write, an agent can type one line into a terminal and, separately, press Enter there. Nothing asks you first; instead you see both happen.

Typing. A line holds at most 4 KiB, with no line breaks, control characters, escape sequences, or Unicode line or paragraph separators. It lands at the child’s current input position, as a paste when the program asked for pastes, as shells and agent prompts do, and as typed characters otherwise. It never brings Enter with it, it queues behind other text still being written, and your own typing cancels text that has not started arriving. Some programs act on printable input at once, so text alone can still do something.

Enter. An agent asks for Enter after reading the terminal, naming what it read. The pane title then shows [Enter pending] for five seconds, and Runyte presses Enter only if, by then, nothing new has appeared in the terminal and nothing has been typed or pasted there. A dialog that pops up, a line of output, a key you press, or another agent’s text each drop the Enter, and the agent is told it was not sent. So do your window detaching and the terminal exiting. Changing or revoking Write, or the agent disconnecting, discards a waiting Enter along with the agent’s connection, and nothing is sent. One Enter can wait per terminal; each agent can have four waiting. A program that redraws constantly, such as a spinner, never receives one.

Limits.

  • Terminal writes and Enter need your window attached; a detached workspace refuses them. They also reach terminals that no pane shows, where you cannot see [Enter pending].
  • A program that has not asked for pastes, such as a pager or a single-key [y/n] prompt, receives the line as keystrokes and may act on its first character without any Enter.
  • Inside tmux, zellij or screen Runyte sees the multiplexer, not the program in its selected pane, so the paste and change checks describe the multiplexer.
  • Delivery means the bytes reached the PTY, not that the child accepted a command. A partial write or lost response is uncertain and is never retried automatically.