Skip to main content

Module command

Module command 

Source
Expand description

The Command helpers domains share: which, run and bounded capture with one error vocabulary. Native only: the page’s build links this crate through the UI’s speech engine, and a browser page has no subprocesses to look up or start. The Command helpers Tilo’s domains share: bounded subprocess execution, so every shell-out shares one error vocabulary (missing binary, non-zero exit, spawn failure) and hands it straight to tracing::warn!.

Constants§

DEFAULT_TIMEOUT
Applies to every shell-out that names no deadline of its own: a tool that exceeds it is killed and reported as a timeout.
MAX_CAPTURE_BYTES
Eight MiB is far above legitimate status or list output, and bounds what a compromised daemon or a network-derived response can make the caller hold.

Functions§

run
run_capture
Runs binary args... under DEFAULT_TIMEOUT, capturing stdout. A wedged or restarting daemon otherwise leaves its client blocked with no bound, and on the compositor’s thread that stops the desktop painting; a deadline turns it into a stale reading, which callers already handle. stdout and stderr are drained on their own threads, because polling while the child writes into an unread pipe deadlocks once the pipe buffer fills.
run_capture_within
which
Walks $PATH in-process rather than shelling out to which(1), which the image does not carry.