From bfff986b2676cd033bc5d35a947aa959773e2fe2 Mon Sep 17 00:00:00 2001 From: iamtoruk Date: Wed, 29 Apr 2026 18:06:35 -0700 Subject: [PATCH] Hide console window when spawning CLI on Windows --- desktop/src-tauri/src/cli.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/desktop/src-tauri/src/cli.rs b/desktop/src-tauri/src/cli.rs index 91c3951..6e3d1de 100644 --- a/desktop/src-tauri/src/cli.rs +++ b/desktop/src-tauri/src/cli.rs @@ -97,11 +97,18 @@ impl CodeburnCli { args.push("--no-optimize".into()); } - let mut child = Command::new(&self.program) - .args(&args) + let mut cmd = Command::new(&self.program); + cmd.args(&args) .stdout(Stdio::piped()) .stderr(Stdio::piped()) - .kill_on_drop(true) + .kill_on_drop(true); + #[cfg(windows)] + { + use std::os::windows::process::CommandExt; + const CREATE_NO_WINDOW: u32 = 0x08000000; + cmd.creation_flags(CREATE_NO_WINDOW); + } + let mut child = cmd .spawn() .with_context(|| format!("failed to spawn {}", self.program))?;