delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/01/19/09:21:48

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: Andrew Innes <andrewi AT gnu DOT org>
To: Daniel Barclay <Daniel DOT Barclay AT digitalfocus DOT com>
Cc: ntemacs-users AT cs DOT washington DOT edu, cygwin AT cygwin DOT com
Subject: Re: NTEmacs shell with CygWin: control-C problem
References: <3A5E3165 DOT AB9DB135 AT digitalfocus DOT com>
Date: 19 Jan 2001 14:20:11 +0000
In-Reply-To: Daniel Barclay's message of "Thu, 11 Jan 2001 17:19:17 -0500"
Message-ID: <u4ryvpqsk.fsf@buffy.cam.eu.citrix.com>
Lines: 42
User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7
MIME-Version: 1.0

On Thu, 11 Jan 2001 17:19:17 -0500, Daniel Barclay <Daniel DOT Barclay AT digitalfocus DOT com> said:
>I'm having trouble with killing commands with control-C in a shell
>buffer.
>
>In a shell buffer in NTEmacs configured per the shell-setup instructions 
>in the CygWin FAQ at http://sources.redhat.com/cygwin/faq/faq.html#SEC5, 
>control-C doesn't seem to work.
>
>That is, typing two control-C's in Emacs (to send a control-C to bash) 
>doesn't kill a long-running command (e.g., like "du /" or "sleep 10").  
>
>Emacs does seem to flash the window title bar, but I can't tell what it's 
>trying to indicate.

It isn't trying to indicate anything - the flashing is an artefact of
the way NTEmacs tries to interrupt subprocesses.  It temporarily gives
input focus to the (still hidden) console window for that subprocess,
simulates the user typing Ctrl-C (or Ctrl-Break in some versions), then
switches focus back to Emacs.  The focus switching is reflected in the
title bar being redrawn as inactive then active again.

>Is this a known problem or common mistake?  Did I just miss something in 
>the NTEmacs FAQ or the CygWin FAQ?

As you've said in another post, this only happens with the 1.x releases
of Cygwin.  They've obviously changed their signal handling in some way
since b20 that causes Emacs' efforts to be ignored.  Even the
alternative method left over from early versions of Emacs (available by
setting `w32-start-process-share-console' to t) doesn't work.  (That
method uses the Windows GenerateConsoleCtrlEvent API.)

I assume bash ignores these console control events because its stdin is
a pipe, and not attached to the console.  Unfortunately, I don't know of
any solution to the problem (short of building Emacs with cygwin so it
can use cygwin's private mechanisms for emulating Unix pty's).

If anyone has the time and inclination to look into what is happening in
cygwin when a CONSOLE_CTRL_C_EVENT is received by bash, when its stdin
is not a tty, it would be very helpful.  A patch to make it work again
would be even better.  [I've copied this mail to cygwin AT cygwin DOT com.]

AndrewI

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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