This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients brian.curtin, docs@python, eli.bendersky, eryksun, nitika
Date 2015-12-05.00:01:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
You can send CTRL_C_EVENT to a process group. But it requires the group leader to manually enable Ctrl+C handling. Initially it's disabled when creating a process with CREATE_NEW_PROCESS_GROUP. 

The attached script demonstrates sending CTRL_C_EVENT to a process group. The child process is the group leader, so CTRL+C event processing has to be manually enabled in it by calling SetConsoleCtrlHandler(NULL, FALSE). This flag gets inherited by the grandchild process. Example output:

    Process 0300: created process 0464
    Process 0464: created process 0456
    Process 0464: received CTRL+C
    Process 0456: received CTRL+C

That said, given that MSDN [erroneously] claims that this isn't possible, probably the subprocess docs should only mention sending CTRL_BREAK_EVENT.
Date User Action Args
2015-12-05 00:01:03eryksunsetrecipients: + eryksun, eli.bendersky, brian.curtin, docs@python, nitika
2015-12-05 00:01:03eryksunsetmessageid: <>
2015-12-05 00:01:03eryksunlinkissue13368 messages
2015-12-05 00:01:03eryksuncreate