From 24b0a563a4b407f505232744f389c0341619c433 Mon Sep 17 00:00:00 2001 From: Raymond Zhao Date: Fri, 11 Feb 2022 09:30:56 -0800 Subject: [PATCH] child_process: kHideConsoleWindows for spawnSync kHideConsoleWindows should hide console windows for execSync and spawnSync calls as well. This fix adds on to https://github.com/nodejs/node/pull/39712. PR-URL: https://github.com/nodejs/node/pull/41412 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- src/spawn_sync.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc index 1141aceae984fb..afd08519d7f897 100644 --- a/src/spawn_sync.cc +++ b/src/spawn_sync.cc @@ -810,6 +810,9 @@ Maybe SyncProcessRunner::ParseOptions(Local js_value) { if (js_win_hide->BooleanValue(isolate)) uv_process_options_.flags |= UV_PROCESS_WINDOWS_HIDE; + if (env()->hide_console_windows()) + uv_process_options_.flags |= UV_PROCESS_WINDOWS_HIDE_CONSOLE; + Local js_wva = js_options->Get(context, env()->windows_verbatim_arguments_string()) .ToLocalChecked();