X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,KHOP_PGP_SIGNED,KHOP_THREADED,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <501AEF74.60909@dancol.org> Date: Thu, 02 Aug 2012 14:21:56 -0700 From: Daniel Colascione User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Ctrl+C not working with windows programs in Cygwin 1.7.16 References: <501AD5B9 DOT 5030005 AT gmail DOT com> <501AE25A DOT 3000309 AT dancol DOT org> <501AEACC DOT 7080604 AT saic DOT com> In-Reply-To: <501AEACC.7080604@saic.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigA22AFDF4A9E78554E085273E" X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --------------enigA22AFDF4A9E78554E085273E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 8/2/2012 2:02 PM, Roger K. Wells wrote: > On 08/02/2012 04:26 PM, Daniel Colascione wrote: >> On 8/2/2012 12:32 PM, Marcin Kielar wrote: >>> Steps to reproduce: >>> >>> 1. Start cygwin using cygwin.bat >>> 2. Run `ping -t google.com` >>> 3. Try breaking it with Ctrl+C >> This problem arises from Cygwin's use of CREATE_NEW_PROCESS_GROUP. From = MSDN: >> >> "When a process is created with CREATE_NEW_PROCESS_GROUP specified, an i= mplicit >> call to SetConsoleCtrlHandler(NULL,TRUE) is made on behalf of the new pr= ocess; >> this means that the new process has CTRL+C disabled. This lets shells ha= ndle >> CTRL+C themselves, and selectively pass that signal on to sub-processes. >> CTRL+BREAK is not disabled, and may be used to interrupt the process/pro= cess >> group." >> >> SetConsoleCtrlHandler(NULL,TRUE) tells a process and all its children to= ignore >> control-C. This problem only affects programs run in a console --- in a = pty, >> Cygwin just terminates Windows processes in response to SIGINT. >> > This may be true but it is a recent development. ISTR a change a little while ago that made Cygwin not send SIGINT to proces= ses controlled by actual consoles (as opposed to ptys) under the assumption tha= t the Windows console machinery would do the job. It looks like the two changes interact unpleasantly. --------------enigA22AFDF4A9E78554E085273E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (Cygwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlAa73cACgkQ17c2LVA10VveQQCfeyP1mfUPwzuY/THcj+3i+s+6 I7kAnj44I+c/azmN2/IHfuz57ZSHh/zR =V6f1 -----END PGP SIGNATURE----- --------------enigA22AFDF4A9E78554E085273E--