Skip to main content

spawn_process

Function spawn_process 

Source
pub async fn spawn_process(
    program: &str,
    args: &[String],
    cwd: &Path,
    env: &HashMap<String, String>,
    arg0: &Option<String>,
) -> Result<SpawnedProcess>
Expand description

Spawn a process using regular pipes (no PTY), returning handles for stdin, output, and exit.

§Example

use vtcode_bash_runner::pipe::spawn_process;
use std::collections::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?;