Skip to main content
The terminal channel runs PTY sessions inside the workspace. Multiple sessions multiplex over one connection, keyed by sessionId. See the WebSocket overview for how to connect and authenticate. A session spawns a shell resolved from $SHELL, falling back to bash. The PTY uses TERM=xterm-256color, starts at 80×24, and runs in the project working directory.

Client to Server

create

Open a new PTY session. Carries only the session ID — sizing is set afterward with resize. Reusing an existing sessionId is an error.

input

Send keystrokes to a session.

resize

Resize a session. Send when the terminal UI changes size. Both dimensions must be positive integers.

close

Close a session and terminate its shell.

Server to Client

output

PTY output, including ANSI escape codes.

close

The session’s shell process exited. The message carries only the session ID — there is no exit code on the wire.

Example Flow