Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
windows: get pid with win32 api (#8785)
Ezekiel Warren36d9b3d48364
diff --git a/Cargo.lock b/Cargo.lockindex 34c59338446..5e1eff04a84 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -9463,6 +9463,7 @@ dependencies = ["theme","thiserror","util",+ "windows 0.53.0",][[package]]diff --git a/crates/terminal/Cargo.toml b/crates/terminal/Cargo.tomlindex 71232649482..c41168d639f 100644--- a/crates/terminal/Cargo.toml+++ b/crates/terminal/Cargo.toml@@ -30,5 +30,11 @@ theme.workspace = truethiserror.workspace = trueutil.workspace = true+[target.'cfg(windows)'.dependencies.windows]+version = "0.53.0"+features = [+ "Win32_System_Threading",+]+[dev-dependencies]rand.workspace = truediff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rsindex 2ae53d40d22..342d4c6cc20 100644--- a/crates/terminal/src/terminal.rs+++ b/crates/terminal/src/terminal.rs@@ -670,7 +670,7 @@ impl Terminal {let mut pid = unsafe { libc::tcgetpgrp(self.shell_fd as i32) };// todo("windows")#[cfg(windows)]- let mut pid = -1;+ let mut pid = unsafe { windows::Win32::System::Threading::GetCurrentProcessId() } as i32;if pid < 0 {pid = self.shell_pid as i32;}