Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

windows: Fix popup window when using external command (#15547)

张小白598d62de04c3
diff --git a/Cargo.lock b/Cargo.lock
index e7b6bff1196..7d62d753934 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 ac4da605b17..1e7801e9088 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 981ee5da14b..0b24e2d95f8 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);