2 Apr 2012 00:45
Re: [PATCH] Ctrl-C and non-Cygwin programs
Christopher Faylor <cgf-use-the-mailinglist-please <at> cygwin.com>
2012-04-01 22:45:13 GMT
2012-04-01 22:45:13 GMT
On Thu, Mar 29, 2012 at 11:55:51AM +0900, Ein Terakawa wrote: >This is a proof of concept demonstration which >makes Ctrl-C behave in a way a lot of people expect >concerning non-Cygwin console programs. > >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. > >To my surprise there seem to be no way to generate CTRL_C_EVENT using API. > >I must also point out that virtually all of the terminal emulators >are sneakily keeping hidden Windows Console in the background. Yes, Cygwin does this by design. It helps some programs work better if they detect that a console is available. >Lastly first third of the patch is a workaround of a problem observed >with cygwin1.dll of cvs HEAD. >To reproduce: >1. Launch a terminal emulator like rxvt or mintty. >2. Execute cmd.exe or more.com from shell prompt. >3. Type in Enter, Ctrl-C, then Enter again. >Whole processes including the terminal emulator will just hung up. I added a fix to Cygwin a couple of days ago which was supposed to fix this. It just avoided trying to process a SIGINT if the user typed CTRL-C when a non-Cygwin program had been execed.(Continue reading)
RSS Feed