This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Brainstorming a fix for CTRL-C handling in an emacs shell buf fer (non-TTY)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]