From 6d5cdede695cd08064f9b7e76b7e4b77a5a78c0c Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 13 May 2014 12:58:01 -0700 Subject: win console wip: ctrl-c should reach commands running in console pools --- src/subprocess-win32.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/subprocess-win32.cc b/src/subprocess-win32.cc index c71f95b..59b2d37 100644 --- a/src/subprocess-win32.cc +++ b/src/subprocess-win32.cc @@ -101,10 +101,13 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) { PROCESS_INFORMATION process_info; memset(&process_info, 0, sizeof(process_info)); + // Ninja handles ctrl-c, except for subprocesses in console pools. + DWORD process_flags = use_console_ ? 0 : CREATE_NEW_PROCESS_GROUP; + // Do not prepend 'cmd /c' on Windows, this breaks command // lines greater than 8,191 chars. if (!CreateProcessA(NULL, (char*)command.c_str(), NULL, NULL, - /* inherit handles */ TRUE, CREATE_NEW_PROCESS_GROUP, + /* inherit handles */ TRUE, process_flags, NULL, NULL, &startup_info, &process_info)) { DWORD error = GetLastError(); -- cgit v0.12