From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22946 invoked by alias); 10 May 2011 17:19:05 -0000 Received: (qmail 22934 invoked by uid 22791); 10 May 2011 17:19:03 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from nm16-vm1.bullet.mail.ne1.yahoo.com (HELO nm16-vm1.bullet.mail.ne1.yahoo.com) (98.138.91.47) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Tue, 10 May 2011 17:18:49 +0000 Received: from [98.138.90.52] by nm16.bullet.mail.ne1.yahoo.com with NNFMP; 10 May 2011 17:18:48 -0000 Received: from [98.138.84.34] by tm5.bullet.mail.ne1.yahoo.com with NNFMP; 10 May 2011 17:18:48 -0000 Received: from [127.0.0.1] by smtp102.mail.ne1.yahoo.com with NNFMP; 10 May 2011 17:18:48 -0000 Received: from cgf.cx (cgf@173.76.56.127 with login) by smtp102.mail.ne1.yahoo.com with SMTP; 10 May 2011 10:18:47 -0700 PDT X-Yahoo-SMTP: jenXL62swBAWhMTL3wnej93oaS0ClBQOAKs8jbEbx_o- Received: from localhost (ednor.casa.cgf.cx [192.168.187.5]) by cgf.cx (Postfix) with ESMTP id 071E34A801A for ; Tue, 10 May 2011 13:18:47 -0400 (EDT) Date: Tue, 10 May 2011 17:19:00 -0000 From: Christopher Faylor To: cygwin@cygwin.com Subject: Re: Who's using "CYGWIN=tty" and why? Message-ID: <20110510171846.GA27537@ednor.casa.cgf.cx> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20110509161028.GJ27739@calimero.vinschen.de> <0105D5C1E0353146B1B222348B0411A209E8030CB9@NIHMLBX02.nih.gov> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0105D5C1E0353146B1B222348B0411A209E8030CB9@NIHMLBX02.nih.gov> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-05/txt/msg00130.txt.bz2 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. cgf -- 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