Server session methods
CONTAINER_STARTING triggers the startup loop. Cancellation produces aborted. The deadline produces timeout.
protocols field to an empty array. It rejects malformed or expired session responses.
Both helpers require wss: URLs. Local development also permits ws: for localhost, 127.0.0.1, and [::1]. The REST operation defines server errors.
Browser entry point
dist/terminal.js as a standalone browser ESM build.
The public SDK package is coming soon. Its installation instructions will appear when the package is available.
Configuration and callbacks
Only
getSession is required. States are idle, connecting, ready, closed, and disposed.
Controller methods
The helper retains the latest dimensions until readiness. It prevents stale session requests from reopening a disposed terminal.
The helper does not automatically reconnect, replay input, or end a deployment.
Handle rejections from
connect() and reconnect(), even with an onError callback. Replacement and disposal reject a pending connection promise.
After readiness, a socket close reports closed through onStateChange. It does not call onError for an ordinary close.
A disposed controller cannot reconnect. Create another controller for a new terminal view.
write() discards input before readiness or after closure. resize() clamps whole-number dimensions to 1 through 500 and rejects non-finite numbers.
xterm integration
This example assumesscreen is an open xterm instance. getSession is your application callback:
terminal.reconnect().
The terminal guide explains session ownership and expiration.