diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b6b43b13..ed5f11273 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,9 +58,6 @@ target_compile_definitions(MinecraftClient PRIVATE ) if(MSVC) configure_msvc_target(MinecraftClient) - # Use CONSOLE subsystem so the shell waits for the process (important for - # Docker and piped output in server mode). WinMainCRTStartup keeps the - # WinMain entry point. Client mode calls FreeConsole() to detach. target_link_options(MinecraftClient PRIVATE /SUBSYSTEM:CONSOLE /ENTRY:WinMainCRTStartup diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index a95fd56fc..8d460de11 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -228,10 +228,7 @@ static BOOL WINAPI HeadlessServerCtrlHandler(DWORD ctrlType) static void SetupHeadlessServerConsole() { - // The exe is linked as /SUBSYSTEM:CONSOLE, so it normally inherits the - // parent's console. However, if launched with DETACHED_PROCESS or - // CREATE_NO_WINDOW the handles may be invalid. Verify before redirecting - // the CRT streams to avoid leaving them in a broken state. + // Verify console handles are valid before redirecting CRT streams HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE); bool hasConsole =