This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: console vs pty (was: Re: First Pass at mintty documentation; etc.)
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 <stdio.h>
>> 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/