diff --git a/Cargo.lock b/Cargo.lock index 34c5933844..5e1eff04a8 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.toml index 7123264948..c41168d639 100644 --- a/crates/terminal/Cargo.toml +++ b/crates/terminal/Cargo.toml @@ -30,5 +30,11 @@ theme.workspace = true thiserror.workspace = true util.workspace = true +[target.'cfg(windows)'.dependencies.windows] +version = "0.53.0" +features = [ + "Win32_System_Threading", +] + [dev-dependencies] rand.workspace = true diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rs index 2ae53d40d2..342d4c6cc2 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; }