diff --git a/Cargo.lock b/Cargo.lock index df93630..43bf35c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -24,6 +24,7 @@ dependencies = [ "tokio-util", "tracing", "uuid", + "windows-sys 0.61.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index bb9c62d..10be4ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -80,6 +80,7 @@ rustc-hash = "2.1.1" shell-words = "1.1" strip-ansi-escapes = "0.2" tower-http = "0.6" +windows-sys = "0.61" # Proc macros diff --git a/src/agent-client-protocol/Cargo.toml b/src/agent-client-protocol/Cargo.toml index cee6a44..1c657b3 100644 --- a/src/agent-client-protocol/Cargo.toml +++ b/src/agent-client-protocol/Cargo.toml @@ -54,6 +54,9 @@ async-process.workspace = true blocking.workspace = true shell-words.workspace = true +[target.'cfg(windows)'.dependencies] +windows-sys = { workspace = true, features = ["Win32_System_Threading"] } + [dev-dependencies] agent-client-protocol-test.workspace = true clap.workspace = true diff --git a/src/agent-client-protocol/src/acp_agent.rs b/src/agent-client-protocol/src/acp_agent.rs index 1a1b2f0..e435051 100644 --- a/src/agent-client-protocol/src/acp_agent.rs +++ b/src/agent-client-protocol/src/acp_agent.rs @@ -162,6 +162,12 @@ impl AcpAgent { for env_var in &stdio.env { cmd.env(&env_var.name, &env_var.value); } + #[cfg(windows)] + { + use async_process::windows::CommandExt as _; + + cmd.creation_flags(windows_sys::Win32::System::Threading::CREATE_NO_WINDOW); + } cmd.stdin(std::process::Stdio::piped()) .stdout(std::process::Stdio::piped()) .stderr(std::process::Stdio::piped());