Resource

terminal

A live terminal owned by the client. Construct with [terminal.constructor] to start a command; consume output() as a stream of raw bytes; await wait-for-exit() for the exit status. Drop the resource to kill and release.

resource terminal;

F output

output: async func() -> stream​<u8>;

Raw byte stream of the terminal's combined output (stdout + stderr in interleaved order). The stream ends when the process exits and any remaining bytes have been flushed.

F wait-for-exit

wait-for-exit: async func() -> result​<terminal-exit-status, error>;

Resolves once the command has exited. Calling this after drop traps; capture the future before dropping if you need the post-mortem.