From e88541f1a77167ab1276bbc47edd2113bfdb1aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Soares?= <37777652+Dnreikronos@users.noreply.github.com> Date: Mon, 27 Apr 2026 11:24:17 -0300 Subject: [PATCH] cli: Null stdio handles when spawning Zed on Windows (#52583) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes #51101 Release Notes: - Fixed issue where launching Zed from Git Bash would leave the Ctrl modifier stuck in the terminal. ## Demo ### Before: https://github.com/user-attachments/assets/301c73a0-768b-437d-8a88-88d7db320c15 ### After: https://github.com/user-attachments/assets/2ec75f5e-16b9-4551-86d9-d59447712e7a --- crates/cli/src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index 459a8266c7..2b5d10b29b 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -1101,7 +1101,7 @@ mod windows { use crate::{Detect, InstalledApp}; use std::io; use std::path::{Path, PathBuf}; - use std::process::ExitStatus; + use std::process::{ExitStatus, Stdio}; fn check_single_instance() -> bool { let mutex = unsafe { @@ -1144,6 +1144,9 @@ mod windows { if let Some(dir) = user_data_dir { cmd.arg("--user-data-dir").arg(dir); } + cmd.stdin(Stdio::null()) + .stdout(Stdio::null()) + .stderr(Stdio::null()); cmd.spawn()?; } else { unsafe {