CYGWIN=tty round 2

Andy Koppe
Mon May 23 11:49:00 GMT 2011

On 23 May 2011 03:53, Yaakov wrote:
>> I've summarized the thread where Corinna asked why people used CYGWIN=tty
>> over CYGWIN=notty below.
>> I don't see any showstoppers here so unless people can provide specific
>> examples of how this change would cause hardwhip, we'll be removing
>> CYGWIN=tty in a snapshot near you soon.
> I could add XWin:

"For some reason which I have yet to investigate, XWin requires a tty to
the log to the terminal.  That means it will output to terminal in VTs,
but will not work in ordinary cmd/bash shells without setting
CYGWIN=tty; instead you will see a cmd window briefly flashing on screen
when launched."

The reason is that XWin.exe is built with -Wl,--subsystem,windows (or
-mwindows, which implies it), which allows it to be invoked directly
from a shortcut or the Run.. dialog without popping up a console or
requiring a console hiding hack. (It's the same for mintty.)

The downside is that Windows also won't hook it up to the parent
process's console, even if there is one, and hence there's nowhere for
Cygwin to hook the standard file descriptors up to.

Having said that, XP introduced the AttachConsole() function, which
allows hooking up to the parent's console by pasing
'ATTACH_PARENT_PROCESS' as the paremeter. It would be very nice if the
Cygwin DLL could try that (followed by CreateFile("CONIN$"/"CONOUT$",
...)) when GetStdHandle returns an invalid handle while initialising
the standard file descriptors.


Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list