summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-12-14 15:44:43 +0100
committerGitHub <noreply@github.com>2021-12-14 15:44:43 +0100
commit965a527775359f4b0c868805ad1876bf87ac2857 (patch)
treeab906fd31057f93d58a1ea2299df8d25d8e4a078
parent15aea89868d16d0310a229d831e4a347a38dc1c3 (diff)
parent6ee48afb4ebac0d4a09c1978163af56fc2be10ad (diff)
Merge pull request #55924 from bruvzg/win_console_4
-rw-r--r--platform/windows/os_windows.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index d2cf9a62ee..d7d78ff5dc 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -484,6 +484,9 @@ Error OS_Windows::create_process(const String &p_path, const List<String> &p_arg
#ifndef DEBUG_ENABLED
dwCreationFlags |= CREATE_NO_WINDOW;
#endif
+ if (p_path == get_executable_path() && GetConsoleWindow() != nullptr) {
+ dwCreationFlags |= CREATE_NEW_CONSOLE;
+ }
int ret = CreateProcessW(nullptr, (LPWSTR)(command.utf16().ptrw()), nullptr, nullptr, false, dwCreationFlags, nullptr, nullptr, si_w, &pi.pi);
ERR_FAIL_COND_V_MSG(ret == 0, ERR_CANT_FORK, "Could not create child process: " + command);