delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/01/23/09:16:06

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Date: Fri, 23 Jan 2009 08:46:59 -0500
From: avadekar AT certicom DOT com
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Re: Signal handling in WIN32 console programs
Message-ID: <20090123134659.GA7000@certicom.com>
Reply-To: avadekar AT certicom DOT com
References: <20090119164151 DOT GA28574 AT certicom DOT com> <4978EBF0 DOT 3090104 AT gmail DOT com> <20090122220422 DOT GA19936 AT ednor DOT casa DOT cgf DOT cx> <20090122230524 DOT GA5850 AT certicom DOT com> <20090123101034 DOT GA32232 AT calimero DOT vinschen DOT de>
Mime-Version: 1.0
In-Reply-To: <20090123101034.GA32232@calimero.vinschen.de>
User-Agent: Mutt/1.4.2.3i
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Fri, Jan 23, 2009 at 05:10:34AM -0500, Corinna Vinschen wrote:
> On Jan 22 18:05, avadekar AT certicom DOT com wrote:
> > On Thu, Jan 22, 2009 at 05:04:23PM -0500, Christopher Faylor wrote:
> > > On Thu, Jan 22, 2009 at 09:58:08PM +0000, Andy Koppe wrote:
> > > > avadekar AT certicom DOT com wrote:
> > > >>  So I
> > > >>wonder if the native console passes the character to the process
> > > >>directly whereas the minTTY/rxvt shells interpret it and send a signal
> > > >>that the native app doesn't really understand properly.
> > > >
> > > >MinTTY and rxvt do not interpret the ^C keypress in any special way.
> > > >They simply write a ^C (0x03) character to the child process' pty.  The
> > > >pty driver may translate that into a signal depending on the pty's line
> > > >settings (as shown by stty).  Sorry I don't know how ^C is processed in
> > > >a Windows console or why the behaviour would be different with ptys.
> > > 
> > > The operative term here is, once again, "Windows Console".  A pure
> > > Windows program running in MinTTY or rxvt does not have a windows
> > > console and so won't see the type of SIGINT that the windows console
> > > generates.
> > 
> > Is there something that I could do inside the native application code to catch
> > what it is getting?  I've tried SetConsoleCtrlhandler, but that also never
> > gets invoked prior to the process termination.
> 
> No.  The Cygwin tty apps like rxvt and MinTTY are using POSIX signal
> handling.  The implementation for that only exists in Cygwin and only
> Cygwin applications are able to deal with them.
> 
> Corinna

It seems that it ought to map to something, or else it wouldn't actually do
anything.  But given that you say I can't do what I'm trying within the posix
shell, I suppose I could have the application open its own console (which would
be native), and then a Ctrl-C in that window would presumably do what I want.

> 
> -- 
> Corinna Vinschen                  Please, send mails regarding Cygwin to
> Cygwin Project Co-Leader          cygwin AT cygwin DOT com
> Red Hat
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019