Skip to main content

hidden_command

Function hidden_command 

Source
pub fn hidden_command(program: impl AsRef<OsStr>) -> Command
Expand description

Compose a PATH for the spawned process that always includes the directory containing the program — where node, npm, and friends usually live in an nvm install. The user’s existing PATH stays as a fallback after our prepended directory. A Command that never opens a console window on Windows.

A GUI host (a Tauri app, an IDE) spawning a console-subsystem CLI gets a black console flashed on screen for every agent run and every --version probe. CREATE_NO_WINDOW suppresses it. Use this in place of Command::new for anything a desktop app spawns; it is a plain Command::new on every other platform, so call sites stay cfg-free.