console flashing, again

Corinna Vinschen
Tue Jun 17 13:15:00 GMT 2008

On Jun 17 05:55, Eric Blake wrote:
> According to Corinna Vinschen on 6/17/2008 4:19 AM:
>> Ok, I'll not touch it in the meantime.
>> However, I don't quite get it.  When you start a non-cygwin app from a X
>> app, shouldn't this start in an invisible console?  CreateFile("CONIN$")
>> shouldn't create a console by itself at least.  But why should setting
>> the console mode bits for input having anything to do with that?!?
> Do you need me to try and capture a stripped down test-case and strace of 
> what emacs is doing?  My particular workflow where I noticed it was using 
> emacs' version-control hooks to query ClearCase for the current state of a 
> checked out file, so emacs is trying to parse the stdout of the non-cygwin 
> app, and I'm not sure whether it is redirecting the stdin from /dev/null.

It appears it's not at all about setting console mode bits, rather it's
just the now missing call to fhandler_console::need_invisible().  Sorry
for meddeling, but... I'm wondering if the below patch would be sufficient.

Can you try?


RCS file: /cvs/src/src/winsup/cygwin/,v
retrieving revision 1.261
diff -u -p -r1.261
---    12 Jun 2008 15:57:23 -0000      1.261
+++    17 Jun 2008 13:12:51 -0000
@@ -441,6 +441,8 @@ spawn_guts (const char *prog_arg, const 
   if (mode == _P_DETACH)
     c_flags |= DETACHED_PROCESS;
+  else
+    fhandler_console::need_invisible ();
   if (mode != _P_OVERLAY)
     myself->exec_sendsig = NULL;

Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

More information about the Cygwin-developers mailing list