From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.help Subject: Re: asynchronous process management on WinWP; buffering problem? Date: Sat, 15 Apr 2006 09:12:06 +0200 Message-ID: <44409CC6.4090409@student.lu.se> References: <10m877fael0h3.1kg7y6ljn4qmb$.dlg@40tude.net> <443fdf5c$1@kcnews01> <877j5r3ogd.fsf@catnip.gol.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1145085156 16538 80.91.229.2 (15 Apr 2006 07:12:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 15 Apr 2006 07:12:36 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 15 09:12:34 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FUexN-000735-G9 for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Apr 2006 09:12:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FUexM-0001k4-8K for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Apr 2006 03:12:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FUex5-0001jJ-0x for help-gnu-emacs@gnu.org; Sat, 15 Apr 2006 03:12:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FUex3-0001ir-Av for help-gnu-emacs@gnu.org; Sat, 15 Apr 2006 03:12:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FUex3-0001im-5E for help-gnu-emacs@gnu.org; Sat, 15 Apr 2006 03:12:13 -0400 Original-Received: from [81.228.11.98] (helo=pne-smtpout1-sn1.fre.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FUexA-0001QB-Vd; Sat, 15 Apr 2006 03:12:21 -0400 Original-Received: from [192.168.123.121] (83.249.218.244) by pne-smtpout1-sn1.fre.skanova.net (7.2.070) id 443D092800078CC5; Sat, 15 Apr 2006 09:12:10 +0200 User-Agent: Thunderbird 1.5 (Windows/20051201) Original-To: Miles Bader In-Reply-To: <877j5r3ogd.fsf@catnip.gol.com> X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:34374 Archived-At: Miles Bader wrote: > Lennart Borgman writes: > >> I do not understand this so I have some (perhaps stupid) questions: >> >> - What determines how the buffering works? >> - Can a program like Emacs change this behaviour? >> - When does the buffering works differently? In a "console"? Is cmd.exe >> a "console"? But is it not just another program? >> > > In unix-like systems, typically a program will test whether the output > stream (stdout) is a terminal or not using something like the > "isatty(1)" function (which is a POSIX standard function I believe). > If it's a terminal it will use line-buffering, if not, it will use a > larger fixed buffer size (which is more efficient). > > -Miles > Jason wrote: I think Emacs can affect the buffering of programs that it invokes directly. In my experience, the buffering problems normally start when a program is run through some other program, the classic example being ssh being run by cvs and the password prompt not appearing in Emacs until you kill cvs. I don't think anything Emacs does can fix this. Thanks Miles and Jason! Can Emacs then tell _isatty that it is a terminal? Or what does Emacs do to handle this? Note: It looks like the POSIX name now is _isatty.