Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Date: Tue, 8 May 2001 12:43:49 -0400
From: Christopher Faylor <cgf@redhat.com>
To: "'cygwin@cygwin.com'" <cygwin@cygwin.com>
Subject: Re: Brainstorming a fix for CTRL-C handling in an emacs shell buf fer (non-TTY)
Message-ID: <20010508124349.B25238@redhat.com>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: "'cygwin@cygwin.com'" <cygwin@cygwin.com>
References: <8F23E55D511AD5119A6800D0B76FDDE11E101F@cpex3.channelpoint.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.11i
In-Reply-To: <8F23E55D511AD5119A6800D0B76FDDE11E101F@cpex3.channelpoint.com>; from troy.noble@channelpoint.com on Tue, May 08, 2001 at 09:45:49AM -0600

On Tue, May 08, 2001 at 09:45:49AM -0600, Troy Noble wrote:
>Christopher,
>
>Here's yet another patch (hopefully at the location of the
>root problem this time).
>
>I'd like to see if you come to the same conclusion as I did.
>
>$ diff -b --unified=3 dtable.cc-orig dtable.cc
>--- dtable.cc-orig      Sat Apr 28 17:48:27 2001
>+++ dtable.cc   Tue May  8 06:36:00 2001
>@@ -120,7 +120,7 @@
>       cygheap->fdtab.init_std_file_from_handle (2, err, GENERIC_WRITE,
>"{stderr}");
>       /* Assign the console as the controlling tty for this process if we
>actually
>         have a console and no other controlling tty has been assigned. */
>-      if (myself->ctty < 0 && GetConsoleCP () > 0)
>+      if (ISSTATE(myself,PID_USETTY) && myself->ctty < 0 && GetConsoleCP ()
>> 0)
>        set_console_ctty ();
>     }
> }
>

This can't be right.  This says "If you are trying to use real ttys and you
have a tty, use the console."  That's not what the code was trying to do.

The "GetConsoleCP ()" call is supposed to determine if there is a
console associated with the process.  Apparently there is, for some
reason.  Apparently, the process which started Xemacs has or had a
cygwin pid associated with it so there is a process group associated
with the tty.

I checked in a patch to in ctrl_c_handler to avoid just returning if the
cygwin pid associated with the pgid of the console is dead.

cgf

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

