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

Christopher Faylor cgf@redhat.com
Tue May 8 12:09:00 GMT 2001


On Tue, May 08, 2001 at 12:45:27PM -0600, Troy Noble wrote:
>Thanks for your patience.
>
>I tried the latest patch you checked in for exceptions.cc.
>That didn't do it either.  I have another alternative though.
>
>I'm beginning to regret the "brainstorming" in the subject of this
>thread, as I'm now feeling somewhat stumped and stupid.  I've fixed
>it 4 different ways now, but haven't quite hit on the right one.
>Sorry for being dense.
>
>Maybe this code that calls set_console_ctty needs to be moved out
>of dtable.cc:stdio_init and into the constructor or init method of
>the fhandler_console?

It's already in the open method for any tty device.

The problem is that stdio_init gets called all the
>time when
>a process starts, and since ctty<0 and GetConsoleCP() is always
>going to return > 0, my ctty and tty->pgid always get set.

The set_console_ctty function is only called when a cygwin program
is invoked by a non-cygwin program.

>I don't think you'd want to run this except when you were creating actual
>fhandler_console instances, right?

A program should have a controlling tty even if it doesn't have a handle open
to the tty.  That means that you can't wait until you initialize a console
or a tty before seting the process's controlling tty.

So, I guess the question is, why is t->getpgid != myself->pid when
ctrl_c_handler is invoked?  What is the value of those two variables?

cgf

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



More information about the Cygwin mailing list