Expand description
Operating-system conditional abstractions.
Platform initialization (initialize_platform) is the first I/O-related
step after signal/telemetry bootstrap in crate::run. It configures:
- Windows: console UTF-8 (code page 65001) + virtual terminal processing for ANSI colors under cmd.exe / PowerShell 5.1 / Windows Terminal
- Linux / Unix: sandbox detection (Flatpak/Snap) with observability warn
- macOS: no-op init (paths via
directories; Gatekeeper is user-side)
§Runtime environment
detect_runtime classifies WSL, containers, CI, Termux, and distribution
sandboxes without spawning external processes. Results feed
vps doctor --json diagnostics (agent-visible, no secrets).
§Product scope (N/A by design)
- Browser / Chrome / chromedriver discovery — not an SSH concern
- WASM / WASI targets —
russhrequires real sockets; not shipped - Job Objects / local
Commandchildren — no privileged local subprocess tree - OpenBSD pledge/unveil, seccomp, setrlimit — optional hardening; not default
§External processes (G-PROC audit)
Runtime never shells out (uname, ssh, scp, systemctl, etc.).
SSH transport is pure russh. The only std::process::Command uses in the
tree are:
| Site | Binary | When | Failure mode |
|---|---|---|---|
build.rs | git (optional) | embed commit hash | unknown / env / .commit_hash |
| integration tests | ssh-keygen (optional fixture) | OpenSSH key files | skip / assert |
| integration tests | ssh-cli under test | assert_cmd e2e | test failure |
Toolchain MSRV 1.85.0 exceeds Rust 1.77.2 (CVE-2024-24576 / BatBadBut);
product still never invokes .bat/.cmd children.
Structs§
- Runtime
Environment - Detected host runtime (process environment classification).
Functions§
- detect_
runtime - Classifies the current process runtime (cheap, side-effect free).
- initialize_
platform - Initializes the platform before user-facing I/O.
- is_tty
- Returns
trueif stdout is connected to a terminal (TTY). - normalize_
stdin_ line - Normalizes a stdin line by stripping trailing
\r(CRLF → LF).