From 2d9f578719b1d850f0e0ba8e3b8cd039c57c693f Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 13 Dec 2019 23:33:11 +1100 Subject: [PATCH] [c-host] windows: don't attach to the debuggers console --- c-host/platform/Windows/src/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c-host/platform/Windows/src/platform.c b/c-host/platform/Windows/src/platform.c index b175151d..a5e66f06 100644 --- a/c-host/platform/Windows/src/platform.c +++ b/c-host/platform/Windows/src/platform.c @@ -160,7 +160,7 @@ static BOOL WINAPI CtrlHandler(DWORD dwCtrlType) int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { /* this is a bit of a hack but without this --help will produce no output in a windows command prompt */ - if (AttachConsole(ATTACH_PARENT_PROCESS)) + if (!IsDebuggerPresent() && AttachConsole(ATTACH_PARENT_PROCESS)) { HANDLE std_err = GetStdHandle(STD_ERROR_HANDLE); HANDLE std_out = GetStdHandle(STD_OUTPUT_HANDLE);