pub fn find_program(program: &str) -> Option<PathBuf>Expand description
The file a bare program name resolves to on PATH, the way the OS shell
would find it.
Spawn agents through this, not by bare name: on Windows Rust’s std
only tries name.exe, so a CLI installed as an npm .cmd shim (codex
since its 2026-09-23 reinstall) is “not found” even though a shell runs it.
On Windows an extensionless file is never a match: npm writes an sh
script beside every .cmd shim, and spawning that fails with os error 193.