X-Spam-Check-By: sourceware.org Date: Mon, 19 Mar 2007 13:51:00 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: rxvt isatty Message-ID: <20070319175100.GB2452@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <45FEBC3E DOT 4080800 AT fit DOT vutbr DOT cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45FEBC3E.4080800@fit.vutbr.cz> User-Agent: Mutt/1.5.11 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list 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/