kaizen/shell/kaizen_child.rs
1// SPDX-License-Identifier: AGPL-3.0-or-later
2//! Detached `kaizen` child process (ingest outlives parent).
3
4use std::ffi::OsString;
5use std::process::{Command, Stdio};
6
7/// Spawn the current binary; never blocks on child.
8pub fn spawn_kaizen_detached(args: &[OsString]) -> std::io::Result<()> {
9 let exe = std::env::current_exe()?;
10 Command::new(exe)
11 .args(args)
12 .stdin(Stdio::null())
13 .stdout(Stdio::null())
14 .stderr(Stdio::null())
15 .spawn()?;
16 Ok(())
17}