delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/07/18/15:50:59

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 18 Jul 2008 20:50:28 +0100 (BST)
From: Hugh Sasse <hgs AT dmu DOT ac DOT uk>
To: Mark Charney <mark_charney AT yahoo DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: Control-c of a bat file does not kill commands run by bat file in some cases
In-Reply-To: <99652.77639.qm@web51005.mail.re2.yahoo.com>
Message-ID: <alpine.LFD.1.10.0807182043030.14074@trueman.cs.cse.dmu.ac.uk>
References: <99652 DOT 77639 DOT qm AT web51005 DOT mail DOT re2 DOT yahoo DOT com>
User-Agent: Alpine 1.10 (LFD 962 2008-03-14)
MIME-Version: 1.0
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, 18 Jul 2008, Mark Charney wrote:

> Is this a bug or a feature?
>
> When I run a program loop.exe   whose entire source is "int main()
> {   while(1);  return 0;}", compiled with MS VS8 or cygwin's gcc,
> from a bat file whose contents are just "loop.exe" and hit
> control-c while it is running, sometimes cygwin kills the loop.exe
> and sometimes it does not. Here are the 6 scenarios that I tried:
>
> 1. OKAY tcsh  from a cmd.exe
> 2. OKAY bash from a cmd.exe
> 3. BROKEN tcsh from an rxvt X window  on local machine
> 4. BROKEN bash from an rxvt X window on local machine
> 5. BROKEN tcsh via ssh from a remote machine  (public key auth)
> 6. BROKEN bash via ssh from a remote machine (public key auth)
>
> OKAY means it kills the bat file and loop.exe
> BROKEN means loop.exe continues to run after control-c.
>
> bash/tcsh doesn't not seem to matter, I just did it because I first noticed the problem on tcsh.

Agreed.

The thing that is varying, it seems to me, is your perceived
terminal type.  I mean as perceived by the system.  Try the
3 ways of connecting {cmd, rxvt, ssh} against 
stty -a
echo $TERM
to see what these things are.  I think stty -a should suffice
to tell you what "intr" is.  Or, in other words, you may have
to hit something other than <ctrl-C> to kill things, unless you
reset it with stty.

         HTH
         Hugh


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