Mark Lofdahl | 25 May 2012 20:43
Picon

Re: [PATCH] Ctrl-C and non-Cygwin programs

References: <4F73CF37.4020001 <at> elfmimi.jp>

On 28/03/2012 10:55 PM, Ein Terakawa wrote:

>What it does actually is it generates CTRL_BREAK_EVENT with 
>Windows Console API GenerateConsoleCtrlEvent on the arrival of SIGINT.
>And to make this scheme to be functional it is required to specify
>CREATE_NEW_PROCESS_GROUP when creating new non-Cygwin processes.

Is there any way for me to get the old behavior? I rely heavily on the
ability to press ctrl-c in my non-cygwin console app and have that app
receive a CTRL_C_EVENT instead of a CTRL_BREAK_EVENT. Everything worked fine
for me before this patch.

>To my surprise there seem to be no way to generate CTRL_C_EVENT using API.

It is possible to generate a CTRL_C_EVENT, if you pass 0 as the process
group id, in which case the event is passed to all process that share the
console. Don't know if that would work in this situation.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms683155.aspx

Thanks,
Mark Lofdahl

Christopher Faylor | 26 May 2012 22:53
Favicon

Re: [PATCH] Ctrl-C and non-Cygwin programs

On Fri, May 25, 2012 at 11:43:11AM -0700, Mark Lofdahl wrote:
>References: <4F73CF37.4020001 <at> elfmimi.jp>
>
>On 28/03/2012 10:55 PM, Ein Terakawa wrote:
>
>>What it does actually is it generates CTRL_BREAK_EVENT with 
>>Windows Console API GenerateConsoleCtrlEvent on the arrival of SIGINT.
>>And to make this scheme to be functional it is required to specify
>>CREATE_NEW_PROCESS_GROUP when creating new non-Cygwin processes.
>
>
>Is there any way for me to get the old behavior? I rely heavily on the
>ability to press ctrl-c in my non-cygwin console app and have that app
>receive a CTRL_C_EVENT instead of a CTRL_BREAK_EVENT. Everything worked fine
>for me before this patch.
>
>>To my surprise there seem to be no way to generate CTRL_C_EVENT using API.
>
>It is possible to generate a CTRL_C_EVENT, if you pass 0 as the process
>group id, in which case the event is passed to all process that share the
>console. Don't know if that would work in this situation.
>http://msdn.microsoft.com/en-us/library/windows/desktop/ms683155.aspx

You're in the wrong mailing list.  You don't ask for stuff here, you provide
patches.  Please use the main Cygwin list.


Gmane