Subject: RE: Control-C, Bash, Command Kill, Bug, Ctrl-C
From: [email-masked] (Mike Grasso)

5 Jun 1998 11:34:15 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
Reply-To: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
To: "Frank Kuan" <[email-masked]>, <[email-masked]>
Cc: <[email-masked]>

Morning all,

> > I have gnu-win32 b19.1
> >
> > In bash, when I Control-C, hoping to kill the current app,
> > I kill all apps I spawned off bash, including emacs sessions
> > etc.  No end of frustration.  I can't figure out how to
> > stop it.  Any ideas?
> >
> > This is, I'm sure, a lame newbie question, but I can't
> > figure it out.  bash.info, archives, faq, all shed no insight.
> >
> > The problem seemed to occur between b18 and b19, since I
> > don't remember it happening in b18.

This behaviour is by design, and has to do with the way CTRL+C et al are
handled under Win32.  You may not like it, but... :-)

Under Win32, a CTRL+C on a console is sent to all processes in the console's
process group.  By default, each new process inherits it's parent process
group.  To the best of my knowledge, there is no way to specify which
process group you want to be in, you can just ask for either your parent's
group or a new one when the process is created.  (See the doc for
CreateProcess.)

I didn't use Cygwin stuff back in b18, but my guess is that back then things
were set up to call CreateProcess with CREATE_NEW_PROCESS_GROUP turned on.
Someone must have had a reason for changing this so that processes from a
single console all share the same process group.  I can't think why you'd
want to do that, other than the fear of running out of process groups...

--
Mike Grasso - [email-masked]
TUSC P/L - 666 Doncaster Road, Doncaster, 3108, Australia
ph +61 3 9840 4451 - fx +61 3 9840 2277 - mb +61 4 1619 4954

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".