diff --git a/src/lib/barrier/win32/DaemonApp.cpp b/src/lib/barrier/win32/DaemonApp.cpp index 62fecf8f..48e7cc8e 100644 --- a/src/lib/barrier/win32/DaemonApp.cpp +++ b/src/lib/barrier/win32/DaemonApp.cpp @@ -130,8 +130,10 @@ DaemonApp::run(int argc, char** argv) } if (foreground) { - // run process in foreground instead of daemonizing. - // useful for debugging. + // add a console to catch Ctrl+C and run process in foreground + // instead of daemonizing. useful for debugging. + if (IsDebuggerPresent()) + AllocConsole(); mainLoop(false); } else {