From 598d62de04c3a267c8a21b2738806ed2915f516e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=B0=8F=E7=99=BD?= <364772080@qq.com> Date: Thu, 29 Aug 2024 10:58:50 +0800 Subject: [PATCH] windows: Fix popup window when using external command (#15547) Thanks techs-sus on Discord. Co-authored-by: shenjack <3695888@qq.com> Co-authored-by: techs-sus Release Notes: - N/A Co-authored-by: shenjack <3695888@qq.com> Co-authored-by: Mikayla Maki --- Cargo.lock | 1 + crates/project/Cargo.toml | 3 +++ crates/project/src/project.rs | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index e7b6bff119..7d62d75393 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8323,6 +8323,7 @@ dependencies = [ "unindent", "util", "which 6.0.3", + "windows 0.58.0", "worktree", ] diff --git a/crates/project/Cargo.toml b/crates/project/Cargo.toml index ac4da605b1..1e7801e908 100644 --- a/crates/project/Cargo.toml +++ b/crates/project/Cargo.toml @@ -71,6 +71,9 @@ text.workspace = true util.workspace = true which.workspace = true +[target.'cfg(target_os = "windows")'.dependencies] +windows.workspace = true + [dev-dependencies] client = { workspace = true, features = ["test-support"] } collections = { workspace = true, features = ["test-support"] } diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index 981ee5da14..0b24e2d95f 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -5449,6 +5449,11 @@ impl Project { })?; let mut child = smol::process::Command::new(command); + #[cfg(target_os = "windows")] + { + use smol::process::windows::CommandExt; + child.creation_flags(windows::Win32::System::Threading::CREATE_NO_WINDOW.0); + } if let Some(working_dir_path) = working_dir_path { child.current_dir(working_dir_path);