From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7397 invoked by alias); 15 Jan 2009 06:00:06 -0000 Received: (qmail 7382 invoked by uid 22791); 15 Jan 2009 06:00:04 -0000 X-Spam-Check-By: sourceware.org Received: from pool-96-233-71-199.bstnma.fios.verizon.net (HELO cgf.cx) (96.233.71.199) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 15 Jan 2009 05:59:28 +0000 Received: from ednor.cgf.cx (ednor.casa.cgf.cx [192.168.187.5]) by cgf.cx (Postfix) with ESMTP id 8135C13C028 for ; Thu, 15 Jan 2009 00:59:17 -0500 (EST) Received: by ednor.cgf.cx (Postfix, from userid 201) id 5B1F52B385; Thu, 15 Jan 2009 00:59:17 -0500 (EST) Date: Thu, 15 Jan 2009 06:54:00 -0000 From: Christopher Faylor To: cygwin@cygwin.com Subject: Re: console vs pty (was: Re: First Pass at mintty documentation; etc.) Message-ID: <20090115055917.GA19035@ednor.casa.cgf.cx> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <496A5EDE.9010204@veritech.com> <496A7038.402@gmail.com> <496B7C25.3090705@veritech.com> <496E528D.1090801@gmail.com> <496E7E4F.6060706@gmail.com> <496ECD29.8010804@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <496ECD29.8010804@gmail.com> User-Agent: Mutt/1.5.16 (2007-06-09) 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: 2009-01/txt/msg00458.txt.bz2 On Thu, Jan 15, 2009 at 05:44:09AM +0000, Andy Koppe wrote: >Chuck Wilson wrote: >>"full screen" or "DOS" is a red herring. Any program that does >>something like the following, if compiled as a native program, won't >>work in rxvt (or MinTTY, or cygwin/cmd-shell-with-CYGWIN=tty): >> >> #include >> main() { >> int c; >> while ((c = getc(stdin)) != EOF) fputc(c, stdout); >> } >> >>The thing is, THIS program works as part of a pipeline even when >>compiled as a native program -- but it breaks if you try to use it >>interactively within rxvt/MinTTY/etc. A cygwin-compiled version works >>in all cases. > >I see, thanks for explaining that. What exactly does happen when >calling read() that means that pty input doesn't reach the program? It's buffered differently. MSVCRT thinks that Cygwin's ptys are pipes so it buffers the input like a pipe rather than a terminal. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/