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
This commit is contained in:
João Soares authored and GitHub committed 2026-04-27 14:24:17 +00:00
1 parent 4230885f49
commit e88541f1a7
1 file changed
+4 -1
+4 -1
View File
@@ -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 {