diff --git a/src-tauri/crates/agent-core/src/core/tools/impls/desktop/peekaboo_cli_tool.rs b/src-tauri/crates/agent-core/src/core/tools/impls/desktop/peekaboo_cli_tool.rs index ad0e39884..4c4198d40 100644 --- a/src-tauri/crates/agent-core/src/core/tools/impls/desktop/peekaboo_cli_tool.rs +++ b/src-tauri/crates/agent-core/src/core/tools/impls/desktop/peekaboo_cli_tool.rs @@ -587,6 +587,11 @@ async fn run_peekaboo_cli_command( #[cfg(unix)] command.process_group(0); + // Suppress the console window the bundled Peekaboo CLI would otherwise + // flash on Windows (it is spawned without a parent console). + #[cfg(windows)] + command.creation_flags(app_platform::CREATE_NO_WINDOW); + let child = command .spawn() .map_err(|err| format!("Failed to run bundled Peekaboo CLI: {}", err))?; diff --git a/src-tauri/crates/app-paths/src/lib.rs b/src-tauri/crates/app-paths/src/lib.rs index 24d8f84ff..bfb6f15c8 100644 --- a/src-tauri/crates/app-paths/src/lib.rs +++ b/src-tauri/crates/app-paths/src/lib.rs @@ -876,9 +876,11 @@ pub fn set_sensitive_file_permissions(path: &Path) -> std::io::Result<()> { #[cfg(windows)] fn current_windows_account_for_acl() -> Option { - let whoami = std::process::Command::new("whoami") - .stdin(Stdio::null()) - .stderr(Stdio::null()) + let mut cmd = std::process::Command::new("whoami"); + cmd.stdin(Stdio::null()).stderr(Stdio::null()); + // Suppress console window on Windows. + app_platform::hide_console(&mut cmd); + let whoami = cmd .output() .ok() .and_then(|output| { diff --git a/src-tauri/src/benchmark/process.rs b/src-tauri/src/benchmark/process.rs index 8c21a5c54..c22aeb94b 100644 --- a/src-tauri/src/benchmark/process.rs +++ b/src-tauri/src/benchmark/process.rs @@ -199,13 +199,16 @@ pub(super) async fn terminate_process(process_id: u32) -> Result<(), String> { .await; #[cfg(windows)] - let output = Command::new("taskkill") - .arg("/PID") - .arg(process_id.to_string()) - .arg("/T") - .arg("/F") - .output() - .await; + let output = { + let mut cmd = Command::new("taskkill"); + cmd.arg("/PID") + .arg(process_id.to_string()) + .arg("/T") + .arg("/F"); + // Suppress the console window on Windows. + cmd.creation_flags(app_platform::CREATE_NO_WINDOW); + cmd.output().await + }; let output = output.map_err(|error| format!("Failed to terminate process {process_id}: {error}"))?;