pub async fn spawn_process(
program: &str,
args: &[String],
cwd: &Path,
env: &HashMap<String, String>,
arg0: Option<&str>,
) -> Result<SpawnedProcess>Expand description
Spawn a process using regular pipes (no PTY), returning handles for stdin, output, and exit.
Copies the borrowed arguments, environment, and optional arg0 into owned
spawn options. arg0 overrides Unix argv[0]; other platforms ignore it.
§Errors
Returns launch or pipe setup failures with process context.
§Example
ⓘ
use vtcode_bash_runner::pipe::spawn_process;
use hashbrown::HashMap;
use std::path::Path;
let env: HashMap<String, String> = std::env::vars().collect();
let spawned = spawn_process("echo", &["hello".into()], Path::new("."), &env, None).await?;
let output_rx = spawned.output_rx;
let exit_code = spawned.exit_rx.await?;