Skip to main content

Module shell

Module shell 

Source
Expand description

Interactive PTY bridge: the local terminal driven against a pty exec.

The exec RPC, output ring, and resize/stdin calls live in crate::exec; this module owns the terminal-facing half: putting the local TTY in raw mode, forwarding raw keystrokes (so the guest’s line discipline turns Ctrl-C/Ctrl-D into signals), pumping merged output, propagating SIGWINCH as a resize, and restoring the terminal on exit.

Sailbox::shell is the high-level entry; the CLI drives run_interactive directly for its --tty flows. Unix-only: on other platforms the calls return an unsupported error and the build still succeeds.

Structs§

ShellOptions
Options for Sailbox::shell.

Functions§

run_interactive
Drive the local terminal against a PTY exec until the remote process exits, returning its exit code. Raw mode and the SIGWINCH handler are always restored, even on error.
stdio_is_tty
True when stdin and stdout are both TTYs, required for an interactive PTY.
terminal_size
The local terminal size as (cols, rows), defaulting to 80x24.