sandbox.pty.
await sandbox.pty.create(cols=80, rows=24, on_output=None)
Create an interactive terminal session. HTTP API →
Terminal columns
Terminal rows
Output callback
PtySession
PtySession
| Member | Type | Description |
|---|---|---|
session_id | str | Session ID |
sandbox_id | str | Sandbox ID |
send(data) | method | Send input (str or bytes) |
await recv() | method | Receive output bytes (Python-unique) |
await close() | method | Close the PTY |
recv() is Python-unique — a pull-based alternative to the on_output callback. Returns raw bytes.