Skip to main content

command

Function command 

Source
pub fn command<S: AsRef<OsStr>>(program: S) -> Command
Expand description

A Command that will not flash a console window when this process has none.

Every child that can be spawned on Windows is built here. The launchd and systemd calls go straight to Command::new, which is the same thing there: the policy below is a no-op off Windows, and neither platform has a console to inherit.

What holds on every platform is the other half. Every child is waited on, and nothing in this program starts a process that outlives the command that started it – there is no detached helper anywhere, which is deliberate and is checked by grepping for .spawn().