From 3f88e5fe836d21acff05d3bc08152351054d00a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Poizl?= Date: Thu, 26 Mar 2026 14:46:23 +0100 Subject: [PATCH] Reopen console on windows when started from cmd.exe --- src/main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index af42213..28bf7bd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,6 +6,9 @@ #include #include #include "../thumbnailer/genthumbnail.h" +#ifdef Q_OS_WIN64 +#include +#endif int main(int argc, char *argv[]) { @@ -19,6 +22,14 @@ int main(int argc, char *argv[]) bool useGLES = true; #endif +#ifdef Q_OS_WIN64 + if(AttachConsole(ATTACH_PARENT_PROCESS)) + { + freopen("CONOUT$", "w", stdout); + freopen("CONOUT$", "w", stderr); + } +#endif + QCommandLineParser cmd; cmd.addOption({"gl", "Use desktop OpenGL. This is default on x86 and MacOS platform."}); cmd.addOption({"gles", "Use OpenGL ES. This is default on ARM platform."});