public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Signal handling in WIN32 console programs
Date: Fri, 23 Jan 2009 13:42:00 -0000	[thread overview]
Message-ID: <20090123101034.GA32232@calimero.vinschen.de> (raw)
In-Reply-To: <20090122230524.GA5850@certicom.com>

On Jan 22 18:05, avadekar@certicom.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@certicom.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

-- 
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/

  reply	other threads:[~2009-01-23 10:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-19 19:07 avadekar
2009-01-22 23:05 ` Andy Koppe
2009-01-22 23:21   ` Christopher Faylor
2009-01-23  4:36     ` avadekar
2009-01-23 13:42       ` Corinna Vinschen [this message]
2009-01-23 15:04         ` avadekar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090123101034.GA32232@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).