Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Don't create console window when creating process
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
patches/node/fix_don_t_create_console_window_when_creating_process.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Raymond Zhao <raymondzhao@microsoft.com> | ||
Date: Tue, 4 Jan 2022 16:11:41 -0800 | ||
Subject: fix: Don't create console window when creating process | ||
|
||
This commit prevents console windows from being spawned, | ||
including for spawnSync and execSync calls. | ||
|
||
Otherwise, Windows users will see command prompts pop up | ||
when making spawnSync or execSync calls. | ||
|
||
The patch can be removed when the windowsHide parameter | ||
for those calls is changed to have a default value of false. | ||
|
||
This patch contains the same fix as | ||
https://github.com/electron/electron/blob/13-x-y/patches/node/fix_don_t_create_console_window_when_creating_process.patch | ||
|
||
diff --git a/deps/uv/src/win/process.c b/deps/uv/src/win/process.c | ||
index 4038fbfd290d1acc91a27ad38e248a2deb06eb68..1ebc0f50e3f0cccb4d8887322b75e61c5284ba2f 100644 | ||
--- a/deps/uv/src/win/process.c | ||
+++ b/deps/uv/src/win/process.c | ||
@@ -1098,6 +1098,9 @@ int uv_spawn(uv_loop_t* loop, | ||
process_flags |= DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP; | ||
} | ||
|
||
+ /* Don't create console window. */ | ||
+ process_flags |= CREATE_NO_WINDOW; | ||
+ | ||
if (!CreateProcessW(application_path, | ||
arguments, | ||
NULL, |