diff options
author | Cheng Zhao <zcbenz@gmail.com> | 2021-08-09 14:02:50 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2021-08-17 20:17:16 +0300 |
commit | fae352a0f5b37e2b4a1b0c636cc786b4a3e6e496 (patch) | |
tree | 477c757b29b3bbeb295db77964bf5d3a8cb9cc75 /src/node_worker.cc | |
parent | f42d7a4552cdf3604833c61cf1d7923b9602833d (diff) |
build: add option to hide console window
Adds a Environment flag to allow embedders to set CREATE_NO_WINDOW
property when spawning processes, which is useful for GUI programs
that do not want to show console windows when running terminal
commands.
PR-URL: https://github.com/nodejs/node/pull/39712
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_worker.cc')
-rw-r--r-- | src/node_worker.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_worker.cc b/src/node_worker.cc index 43a3862cc69..3e3cb67d9e8 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -558,6 +558,8 @@ void Worker::New(const FunctionCallbackInfo<Value>& args) { CHECK(args[4]->IsBoolean()); if (args[4]->IsTrue() || env->tracks_unmanaged_fds()) worker->environment_flags_ |= EnvironmentFlags::kTrackUnmanagedFds; + if (env->hide_console_windows()) + worker->environment_flags_ |= EnvironmentFlags::kHideConsoleWindows; } void Worker::StartThread(const FunctionCallbackInfo<Value>& args) { |