| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1a8a26d commit ed3c332
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -906,6 +906,10 @@ inline bool Environment::tracks_unmanaged_fds() const { | |||
| 906 | 906 | return flags_ & EnvironmentFlags::kTrackUnmanagedFds; | |
| 907 | 907 | } | |
| 908 | 908 | ||
| 909 | + inline bool Environment::hide_console_windows() const { | ||
| 910 | + return flags_ & EnvironmentFlags::kHideConsoleWindows; | ||
| 911 | + } | ||
| 912 | + | ||
| 909 | 913 | bool Environment::filehandle_close_warning() const { | |
| 910 | 914 | return emit_filehandle_warning_; | |
| 911 | 915 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1058,6 +1058,7 @@ class Environment : public MemoryRetainer { | |||
| 1058 | 1058 | inline bool owns_process_state() const; | |
| 1059 | 1059 | inline bool owns_inspector() const; | |
| 1060 | 1060 | inline bool tracks_unmanaged_fds() const; | |
| 1061 | + inline bool hide_console_windows() const; | ||
| 1061 | 1062 | inline uint64_t thread_id() const; | |
| 1062 | 1063 | inline worker::Worker* worker_context() const; | |
| 1063 | 1064 | Environment* worker_parent_env() const; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -424,7 +424,11 @@ enum Flags : uint64_t { | |||
| 424 | 424 | kNoRegisterESMLoader = 1 << 3, | |
| 425 | 425 | // Set this flag to make Node.js track "raw" file descriptors, i.e. managed | |
| 426 | 426 | // by fs.open() and fs.close(), and close them during FreeEnvironment(). | |
| 427 | - kTrackUnmanagedFds = 1 << 4 | ||
| 427 | + kTrackUnmanagedFds = 1 << 4, | ||
| 428 | + // Set this flag to force hiding console windows when spawning child | ||
| 429 | + // processes. This is usually used when embedding Node.js in GUI programs on | ||
| 430 | + // Windows. | ||
| 431 | + kHideConsoleWindows = 1 << 5 | ||
| 428 | 432 | }; | |
| 429 | 433 | } // namespace EnvironmentFlags | |
| 430 | 434 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -595,6 +595,8 @@ void Worker::New(const FunctionCallbackInfo<Value>& args) { | |||
| 595 | 595 | CHECK(args[4]->IsBoolean()); | |
| 596 | 596 | if (args[4]->IsTrue() || env->tracks_unmanaged_fds()) | |
| 597 | 597 | worker->environment_flags_ |= EnvironmentFlags::kTrackUnmanagedFds; | |
| 598 | + if (env->hide_console_windows()) | ||
| 599 | + worker->environment_flags_ |= EnvironmentFlags::kHideConsoleWindows; | ||
| 598 | 600 | } | |
| 599 | 601 | ||
| 600 | 602 | void Worker::StartThread(const FunctionCallbackInfo<Value>& args) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -238,6 +238,10 @@ class ProcessWrap : public HandleWrap { | |||
| 238 | 238 | options.flags |= UV_PROCESS_WINDOWS_HIDE; | |
| 239 | 239 | } | |
| 240 | 240 | ||
| 241 | + if (env->hide_console_windows()) { | ||
| 242 | + options.flags |= UV_PROCESS_WINDOWS_HIDE_CONSOLE; | ||
| 243 | + } | ||
| 244 | + | ||
| 241 | 245 | // options.windows_verbatim_arguments | |
| 242 | 246 | Local<Value> wva_v = | |
| 243 | 247 | js_options->Get(context, env->windows_verbatim_arguments_string()) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments