From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Benjamin Riefenstahl Newsgroups: gmane.emacs.devel,gmane.emacs.help Subject: Re: asynchronous process management on WinWP; buffering problem? Date: Sat, 15 Apr 2006 19:54:54 +0200 Message-ID: References: <10m877fael0h3.1kg7y6ljn4qmb$.dlg@40tude.net> <443fdf5c$1@kcnews01> <877j5r3ogd.fsf@catnip.gol.com> <444110BE.3050009@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1145123766 15599 80.91.229.2 (15 Apr 2006 17:56:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 15 Apr 2006 17:56:06 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, Jason Rumney , Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 15 19:56:04 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FUp07-0002WX-14 for ged-emacs-devel@m.gmane.org; Sat, 15 Apr 2006 19:56:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FUp06-0003YF-AL for ged-emacs-devel@m.gmane.org; Sat, 15 Apr 2006 13:56:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FUozq-0003VL-BO for emacs-devel@gnu.org; Sat, 15 Apr 2006 13:55:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FUozp-0003TS-6o for emacs-devel@gnu.org; Sat, 15 Apr 2006 13:55:45 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FUozl-0003PF-Gm; Sat, 15 Apr 2006 13:55:41 -0400 Original-Received: from [193.99.153.30] (helo=seneca.benny.turtle-trading.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FUp00-0007Ll-DU; Sat, 15 Apr 2006 13:55:56 -0400 Original-Received: from seneca.benny.turtle-trading.net.turtle-trading.net (seneca.benny.turtle-trading.net [127.0.0.1]) (authenticated bits=0) by seneca.benny.turtle-trading.net (8.12.8/8.12.8) with ESMTP id k3FHstLo024952; Sat, 15 Apr 2006 19:55:00 +0200 Original-To: Lennart Borgman In-Reply-To: <444110BE.3050009@student.lu.se> (Lennart Borgman's message of "Sat, 15 Apr 2006 17:26:54 +0200") User-Agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:52902 gmane.emacs.help:34380 Archived-At: Hi Lennart, Lennart Borgman writes: > It actually seems like is _isatty is defined in MinGW. I just tested > a small program I found here: The function isatty is defined in the Microsoft C runtime, and that is what Mingw uses. This version of isatty determines if a program is running with stdin/stdout connected to an MS Windows console. The way that consoles are implemented and used in MS Windows makes it very complicated to use the console API to simulate a terminal in Emacs. On Unix-like systems this is done by so-called "pseudo-ttys", "pty", but the MS Windows consoles are quite different beasts at the OS API level. Emacs would have to do a large amount of reverse-engineering of the intent of the child process, to do with consoles what Emacs does quite naturally on Unix with pseudo-ttys, and there would still be features missing. Therefore Emacs just uses anonymous pipes instead which are a much better fit for the way Emacs treats child processes, but that means that it can't make isatty in child processes return true. Cygwin can implement pseudo-ttys if it controls the parent as well as the child, e.g. when you call a Cygwin program from a Cygwin compiled Emacs. It uses its own conventions to do that which are not understood by non-Cygwin programs. Sometimes you have a program that uses isatty to determine if it should work in interactive mode or not, like the command shells of a programming language or the some SQL interpreters. In those cases you will need to find a way put it into interactive mode without the help of isatty. Sometimes the shell will have a command-line option for that, in other cases it can be configured after its start. benny