Who's using "CYGWIN=tty" and why?

Christopher Faylor cgf-use-the-mailinglist-please@cygwin.com
Tue May 10 17:19:00 GMT 2011

On Tue, May 10, 2011 at 09:37:43AM -0400, Buchbinder, Barry (NIH/NIAID) [E] wrote:
>Corinna Vinschen sent the following at Monday, May 09, 2011 12:10 PM
>>Chris and I are wondering how many people are using the Windows console
>>as local console window in CYGWIN=tty mode and why.
>I've been using it for so long that I do not remember why - probably
>because I thought it was recommended.
>I did some testing yesterday and found that with CYGWIN=tty each
>console gets a unique number, as visible in /bin/tty, ps, and
>$(cat /proc/$$/ctty).  Without it, one gets "con" (tty and ps) or a
>long, nonunique number (/proc).  I use the tty number to keep track
>of console windows.

If we changed the /dev/console to /dev/consN (where N is a unique number
for each console window) would that address your use case?

You would not be able to do something like echo foo >/dev/cons4 and have
foo be echoed another console window though.

>In the past, I've played with minty and haven't felt the need to
>switch.  I did an abbreviated test (just ps) with minty and it had
>tty numbers without CYGWIN=tty.

I think Corinna and I both suffered from the misperception that people
were familiar with Cygwin's handling of ttys.  mintty uses ptys.
Cygwin's ttys and ptys are pretty much the same thing.  Cygwin ttys have
some extra handshaking which slows down I/O somewhat wrt ptys.  And,
using CYGWIN=tty means setting up extra threads in the first process
starting in a console window.  So, yes, you'll see /dev/ttyN as the
controlling terminal in a tty application.

It was in a discussion with Corinna where I was contemplating
eliminating the handshaking that Corinna asked the fateful "Why do we
need CYGWIN=tty" question.  Eliminating the special case of tty handling
would simplify the cygwin pty layer, shrink the size of the DLL, and
generally make Cygwin a little easier to maintain.


Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

More information about the Cygwin mailing list