www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/06/05/11:34:27

From: mjg AT tusc DOT com DOT au (Mike Grasso)
Subject: RE: Control-C, Bash, Command Kill, Bug, Ctrl-C
5 Jun 1998 11:34:27 -0700 :
Message-ID: <001801bd9014$14841cb0$7fb002cb.cygnus.gnu-win32@mjg.tusc.com.au>
References: <357730D0 DOT 70BBC24 AT alumni DOT stanford DOT org>
Reply-To: <mjg AT tusc DOT com DOT au>
Mime-Version: 1.0
To: <chamas AT alumni DOT stanford DOT org>
Cc: "Frank Kuan" <kuan AT agames DOT com>, <gnu-win32 AT cygnus DOT com>

Morning Joshua

> Thanks for the informed opinion!  Fortunately, I was able to
> download and get tcsh to work.  Not only does the Control-C
> work unix style, but Control-Z (suspend) does too!  Yeah.

Hmm... This suggests that the "problem" (or feature, depending on the
marketing) lies in the code to the shell.  I thought this might be the case,
because I can get Cygwin bash to leave certain processes alive through a
CTRL+C, provided I start them in a new sub-shell.  For instance:

> ~ $ (sleep 5000)&
> [1] 1001
> ~ $
> ~ $ jobs
> [1]+  Running                 ( sleep 5000 ) &
> ~ $ sleep 10
>
> ~ $ jobs
> [1]+  Running                 ( sleep 5000 ) &
> ~ $

So, provided you start a process in a new sub-shell (which is essentially
what enclosing it in brackets does) it will survive a CTRL+C.  This suggests
that the shell is creating a new process group for each new shell and
sub-shell, but start all other processes in it's own group.

The upshot of this is that if you fiddle with bash a bit, you ought to be
able to change this, or at least make it configurable.

> b19 bash would be nice to use, but it's too much a pain in the butt
> with that control-c "feature".
>
> Thanks again.  Leave in to Win32 API's to not make sense.

Well, I can think of ways of using this feature, and can think why the
designers may have chosen to design things this way.  Personally though, I
think that any feature that takes flexibility away from the programmer is a
bad one.  But that's just a personal view, and I guess it's not one that the
Win32 team agree with. :-)

--
Mike Grasso - mjg AT tusc DOT com DOT au
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
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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