From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#46388: 27.1; emacs -batch does not output messages immediately when invoked outside of the command prompt Date: Tue, 09 Feb 2021 00:36:33 -0500 Message-ID: References: Reply-To: Eli Zaretskii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25215"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46388@debbugs.gnu.org To: Ioannis Kappas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 09 06:37:09 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9Li0-0006Sg-Kq for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Feb 2021 06:37:08 +0100 Original-Received: from localhost ([::1]:34476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9Lhz-0005sC-N5 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Feb 2021 00:37:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Lhu-0005s3-6x for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2021 00:37:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40834) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l9Lht-00021u-W9 for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2021 00:37:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l9Lht-0005ZO-Si for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2021 00:37:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Feb 2021 05:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46388 X-GNU-PR-Package: emacs Original-Received: via spool by 46388-submit@debbugs.gnu.org id=B46388.161284900221384 (code B ref 46388); Tue, 09 Feb 2021 05:37:01 +0000 Original-Received: (at 46388) by debbugs.gnu.org; 9 Feb 2021 05:36:42 +0000 Original-Received: from localhost ([127.0.0.1]:52380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9Lha-0005Yp-Cg for submit@debbugs.gnu.org; Tue, 09 Feb 2021 00:36:42 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9LhY-0005Yd-0H for 46388@debbugs.gnu.org; Tue, 09 Feb 2021 00:36:41 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39049) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9LhS-0001fZ-QB; Tue, 09 Feb 2021 00:36:34 -0500 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1l9LhR-0002lF-EV; Tue, 09 Feb 2021 00:36:33 -0500 In-Reply-To: (message from Ioannis Kappas on Mon, 8 Feb 2021 21:42:09 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199654 Archived-At: > From: Ioannis Kappas > Date: Mon, 8 Feb 2021 21:42:09 +0000 > > A solution thus to correct this behavior in emacs -batch on > windows-nt would be to check if it is connected to the console, > and when not, set stderr mode to unbuffered. Thanks for the analysis and the patch proposal. However, I don't think this is a good idea. For starters, stderr could be connected to a file, in which case we do want it to be buffered. More generally, stderr could be used for something other than outputting urgent messages, in which case making it unbuffered will make I/O less efficient for no good reason. And this would make Emacs on Windows behave differently from Posix systems, which is also a downside. I think a much better way forward in this area is to teach Emacs to use the Pseudo Consoles introduced in recent Windows versions. That would allow us to support subprocess communications via PTYs on MS-Windows, and thus will solve this and other similar issues. Patches to support PTYs on Windows are welcome.