pty_exited message is reported as a transport disconnect.
Session IDs are scoped to the current running machine execution; after
hibernate/resume, create a new PTY session.
PTY sessions are created over the machine WebSocket channel
(/v1/machines/{id}/ws); the SDKs and CLI manage that connection. List, resize,
and kill also have REST endpoints (see Manage sessions).
Create a session
Disconnect and reconnect
Reconnecting to an existing session bysession_id is available from the Python
SDK and CLI, and over the machine WebSocket for raw clients. The TypeScript SDK
opens a new session per pty.open() call and does not reconnect to an existing
session.
session_id printed by machine pty create with --session-id.
Numeric pid reconnect remains available for legacy scripts. In a local TTY,
connect forwards keyboard input, streams PTY output, and tracks terminal
resize events. With --json, it waits for completion, forwards piped stdin
when present, and prints the final result. PTY session IDs and legacy PIDs are
not durable across hibernate/resume.
Manage sessions
Listing, resizing, and killing sessions are available across all clients and use thesession_id returned by create.
id, session_id, pid, is_connected,
exit_code, and error. It also supports byte iteration when you want to read
PTY output directly:
session.resize(cols, rows) for the active WebSocket handle. Use
resize_session(session_id, cols, rows) when you are managing a session by ID.