Fix Ctrl+C not working when Zed is launched from CLI (#39482)

John Tur created

Closes https://github.com/zed-industries/zed/issues/38383
Closes https://github.com/zed-industries/zed/issues/39330

Release Notes:

- N/A

Change summary

crates/auto_update_helper/src/updater.rs | 6 +-----
crates/cli/src/main.rs                   | 5 ++---
2 files changed, 3 insertions(+), 8 deletions(-)

Detailed changes

crates/auto_update_helper/src/updater.rs 🔗

@@ -1,5 +1,4 @@
 use std::{
-    os::windows::process::CommandExt,
     path::Path,
     time::{Duration, Instant},
 };
@@ -7,7 +6,6 @@ use std::{
 use anyhow::{Context as _, Result};
 use windows::Win32::{
     Foundation::{HWND, LPARAM, WPARAM},
-    System::Threading::CREATE_NEW_PROCESS_GROUP,
     UI::WindowsAndMessaging::PostMessageW,
 };
 
@@ -207,9 +205,7 @@ pub(crate) fn perform_update(app_dir: &Path, hwnd: Option<isize>, launch: bool)
     }
     if launch {
         #[allow(clippy::disallowed_methods, reason = "doesn't run in the main binary")]
-        let _ = std::process::Command::new(app_dir.join("Zed.exe"))
-            .creation_flags(CREATE_NEW_PROCESS_GROUP.0)
-            .spawn();
+        let _ = std::process::Command::new(app_dir.join("Zed.exe")).spawn();
     }
     log::info!("Update completed successfully");
     Ok(())

crates/cli/src/main.rs 🔗

@@ -731,15 +731,15 @@ mod windows {
             Storage::FileSystem::{
                 CreateFileW, FILE_FLAGS_AND_ATTRIBUTES, FILE_SHARE_MODE, OPEN_EXISTING, WriteFile,
             },
-            System::Threading::{CREATE_NEW_PROCESS_GROUP, CreateMutexW},
+            System::Threading::CreateMutexW,
         },
         core::HSTRING,
     };
 
     use crate::{Detect, InstalledApp};
+    use std::io;
     use std::path::{Path, PathBuf};
     use std::process::ExitStatus;
-    use std::{io, os::windows::process::CommandExt};
 
     fn check_single_instance() -> bool {
         let mutex = unsafe {
@@ -778,7 +778,6 @@ mod windows {
         fn launch(&self, ipc_url: String) -> anyhow::Result<()> {
             if check_single_instance() {
                 std::process::Command::new(self.0.clone())
-                    .creation_flags(CREATE_NEW_PROCESS_GROUP.0)
                     .arg(ipc_url)
                     .spawn()?;
             } else {