Skip to main content

Module shell

Module shell 

Source
Expand description

A shell the device’s shell runtime runs, carried on an app’s connection. The shell lane an app’s own connection carries: a shell the device’s shell runtime runs, with its terminal kept by the device and its bytes carried to the app.

An app’s process is sandboxed: it holds no socket of the shell runtime’s and starts no program of the device’s. An app whose signed manifest declares it may open shells (shells) asks the device for one on its connection (ShellOpen). The device opens it on its one connection to the runtime, in the workspace the app was started in and never another, keeps the terminal the runtime hands it, and from then on carries the session on this connection: what the app types (ShellBytes as ShellInput), the window’s size, the shell’s output back (ShellOutput) and, last, how the session ended (ShellEnded). Closing the shell (ShellClose) or the connection lets the session go.

Structs§

ShellBytes
Bytes of one shell’s input or output.
ShellEnded
How a shell’s session ended: the runtime’s own report ({"ended": "lost", "reason": ...}), empty when the shell exited and nothing more was said.
ShellOpen
A shell to open: where it runs and how it starts.
ShellOpened
An opened shell: what the app names it by on the connection, and what the runtime said of it.

Constants§

MAX_SHELL_BYTES
The most bytes one frame of a shell’s input or output carries.

Functions§

lost_report
The report of a session whose connection to the device was lost: the device’s word for ShellEnded when it can no longer say anything itself.