From 92ea0d3a80e0f043f9b3ac2cf50f479eaf935a63 Mon Sep 17 00:00:00 2001 From: Raymond Zhao Date: Wed, 5 Jan 2022 09:00:03 -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. --- 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();