This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: rxvt isatty
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 19 Mar 2007 13:51:00 -0400
- Subject: Re: rxvt isatty
- References: <45FEBC3E.4080800@fit.vutbr.cz>
- Reply-to: cygwin at cygwin dot com
On Mon, Mar 19, 2007 at 05:37:18PM +0100, PCJohn wrote:
>I was trying to port ivTools
>(http://merlin.fit.vutbr.cz/wiki/index.php?title=Open_Inventor_Tools) to
> work smoothly with Cygwin. It works on Cygwin console without problems
>($CYGWIN=notty), but rxvt causes all the utilities to freeze.
>
>I found the problem: utilities are testing stdin by isatty. If
>isatty==false, stdin is used for reading the data. If isatty returns
>true, there is really bad idea to wait that user will feed the program
>by complex 3D geometry, and utility is started without reading stdin.
>
>If rxvt is used, isatty returns always false and application does not
>work as expected. I realized that some advanced console functionality is
>provided with rxvt (pty, pipes) to overcome the limitations of windows
>console. My question: Can I find out in if the application is running
>interactive or not? If it was started like:
>app_name.exe < in.txt
>echo data | app_name.exe
>or
>app_name.exe
>
>Another minor question: How to use the advanced functionalities provided
>by pty and pipes? Just get_osfhandle(fileno(stdin)), ReadFile, and
>WriteFile?
Given that you're talking about things like isatty returning false,
get_osfhandle, ReadFile, and WriteFile, I surmise that you're trying to
run a non-Cygwin-based program under rxvt. None of those are Linux/UNIX
functions and, if you use them in a Cygwin program there are no guarantees
that you will be able to use any of Cygwin's UNIX/Linux-like features.
Cygwin's ptys are entirely an invention of Cygwin so, to avail yourself
of ptys you can't build the application with MSVC or gcc -mno-cygwin or
MinGW gcc. You really need to build your program so that it uses the
cygwin dll, i.e., it has to be compiled with the normal Cygwin gcc.
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/