This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: Brainstorming a fix for CTRL-C handling in an emacs shell buf fer (non-TTY)
- To: "'cygwin at cygwin dot com'" <cygwin at cygwin dot com>
- Subject: Re: Brainstorming a fix for CTRL-C handling in an emacs shell buf fer (non-TTY)
- From: Christopher Faylor <cgf at redhat dot com>
- Date: Tue, 8 May 2001 12:43:49 -0400
- References: <8F23E55D511AD5119A6800D0B76FDDE11E101F@cpex3.channelpoint.com>
- Reply-To: cygwin at cygwin dot com
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