Skip to content

Fix spawning excessive conhost processes on Windows #1143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions src/mock_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ pub trait RunCommand: fmt::Debug + Send {
fn env_clear(&mut self) -> &mut Self;
/// Set the working directory of the process to `dir`.
fn current_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut Self;
/// Create the proces without a visible console on Windows.
fn no_console(&mut self) -> &mut Self;
/// Set the process' stdin from `cfg`.
fn stdin(&mut self, cfg: Stdio) -> &mut Self;
/// Set the process' stdout from `cfg`.
Expand Down Expand Up @@ -237,19 +235,6 @@ impl RunCommand for AsyncCommand {
self
}

#[cfg(windows)]
fn no_console(&mut self) -> &mut AsyncCommand {
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x08000000;
self.inner().creation_flags(CREATE_NO_WINDOW);
self
}

#[cfg(unix)]
fn no_console(&mut self) -> &mut AsyncCommand {
self
}

fn stdin(&mut self, cfg: Stdio) -> &mut AsyncCommand {
self.inner().stdin(cfg);
self
Expand Down Expand Up @@ -474,9 +459,6 @@ impl RunCommand for MockCommand {
//TODO: assert value of dir
self
}
fn no_console(&mut self) -> &mut MockCommand {
self
}
fn stdin(&mut self, _cfg: Stdio) -> &mut MockCommand {
self
}
Expand Down
1 change: 0 additions & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ where
C: RunCommand,
{
let child = command
.no_console()
.stdin(if input.is_some() {
Stdio::piped()
} else {
Expand Down