From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#72426: 29.2.50; comint-pager doesn't affect async-shell-command Date: Tue, 06 Aug 2024 15:23:25 -0400 Message-ID: References: <86sevmupgo.fsf@gnu.org> <86bk29vcof.fsf@gnu.org> <26b6e3e6-7eee-686d-013b-0fc02c4125fe@gmail.com> <8634nhps4t.fsf@gnu.org> <86v80do795.fsf@gnu.org> <86o765o4gg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37637"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: jporterbugs@gmail.com, 72426@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 06 21:24:16 2024 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 1sbPn6-0009cs-4E for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Aug 2024 21:24:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbPmY-0001Cj-2F; Tue, 06 Aug 2024 15:23:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbPmV-000153-Bd for bug-gnu-emacs@gnu.org; Tue, 06 Aug 2024 15:23:39 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbPmU-0005HF-SU for bug-gnu-emacs@gnu.org; Tue, 06 Aug 2024 15:23:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=5/Zko128byxUbvxidY6/33ykjde/8D2TwQYuPmJLkx8=; b=kRX5hFzGF6xOvHJ5QRUiM4YgaC5E9YJl6iKWxHIHTdqTg90QlOiN1IXrl9YDvLJAeZkAsR0lx02cSPDTTBUC/9rK0qRf1jtDSqGu45Oxe/JJHu1fTkqyRdHAUR8GKbcWWlJfmfCxU5fMyz8p0DxJ9G3Gycyask2pQGfWCWHjkF7zjuh6JfTWPe2z/Zx5/tI79o/V/KxUDMrJoFS42Rb3PLquh8O/kzklTzFX3ELRztepnKANwIjc+FsQ/h0tmjWzjG3Sf8bg7v5S5SER6TpT9IgY4DRWAtB1t5cpO25jwiFForxQyQl47MQzx7Y9NtegYEo6H+2oT2vY4wvGXFmZ/A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sbPms-0007T2-MY for bug-gnu-emacs@gnu.org; Tue, 06 Aug 2024 15:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Aug 2024 19:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72426 X-GNU-PR-Package: emacs Original-Received: via spool by 72426-submit@debbugs.gnu.org id=B72426.172297223828675 (code B ref 72426); Tue, 06 Aug 2024 19:24:02 +0000 Original-Received: (at 72426) by debbugs.gnu.org; 6 Aug 2024 19:23:58 +0000 Original-Received: from localhost ([127.0.0.1]:33092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbPmn-0007SR-Iy for submit@debbugs.gnu.org; Tue, 06 Aug 2024 15:23:57 -0400 Original-Received: from mxout1.mail.janestreet.com ([38.105.200.78]:45333) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbPml-0007SC-LZ for 72426@debbugs.gnu.org; Tue, 06 Aug 2024 15:23:56 -0400 In-Reply-To: <86o765o4gg.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 06 Aug 2024 22:07:27 +0300") DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1722972205; bh=5/Zko128byxUbvxidY6/33ykjde/8D2TwQYuPmJLkx8=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=eOYljSXuTJsVbA/JLi3ZBA1lIkB+8suNo70i/WIWL4FzWhGQnhTFE42AbTYeWFnxc ln/xpHUcl6UjhvOo42E6CHW8grpP/1G/cqlGSuyGSOOoYuidx4A5ohlycrOfqfgjWh 45/EC/j4JwLVud+I1vAvPz3BXl1dSxX8FmB+L1bH45Ve/dQDRgJJ3HrP+E83qO31aV tBG7JkJ3BBzfWu8c58+UU8VMV7Ja53dJ7uOakl/CmmlHsNtpUk0Th+oVezsi+k4Hi9 cRerfiCpNnLvNOUITTYq6oLthnOQEnDDW56k0Ms0Pj2pZVkH5DADDzAm0+qXbPUule aN0hNMixlndQQ== 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289860 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: jporterbugs@gmail.com, 72426@debbugs.gnu.org >> Date: Tue, 06 Aug 2024 14:49:45 -0400 >> >> Eli Zaretskii writes: >> >> >> From: Spencer Baugh >> >> Cc: jporterbugs@gmail.com, 72426@debbugs.gnu.org >> >> Date: Tue, 06 Aug 2024 12:42:09 -0400 >> >> >> >> --- a/lisp/startup.el >> >> +++ b/lisp/startup.el >> >> @@ -854,6 +854,10 @@ normal-top-level >> >> ;; We are careful to do it late (after term-setup-hook), although the >> >> ;; new multi-tty code does not use $TERM any more there anyway. >> >> (setenv "TERM" "dumb") >> >> + ;; Likewise, subprocesses should not use a pager unless told >> >> + ;; otherwise, since it generally won't work. >> >> + (when (executable-find "cat") >> >> + (setenv "PAGER" "cat")) >> > >> > We need to work on the comment, because it doesn't explain any of what >> > it needs to. Worse, it says something very confusing and at least >> > inaccurate. >> >> Could you just say what you'd prefer the comment to be? I'm not sure >> what exactly you'd like it to explain. > > I don't have a clear enough idea; I hoped you did, since you initiated > this change to begin with. I just know that the text you wrote cannot > be it, because it didn't explain to me anything about the reasons we > should be doing this. The comment should explain why PAGER=cat is a > good idea to go with TERM=dumb, for example. Maybe begin by saying > why Emacs needs to set the variable at all, why not leave it unset? OK, how about this? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Stop-subprocesses-from-using-inherited-or-default-PA.patch >From b50a5ef015280a585330d4fcfc1265d65ce1dd88 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Tue, 6 Aug 2024 12:39:37 -0400 Subject: [PATCH] Stop subprocesses from using inherited or default PAGER At startup, set PAGER to cat so that any inherited or default value of PAGER does not affect subprocesses of Emacs. Pagers generally won't work when a subprocess runs under Emacs. A user can use comint-pager (or other customizations) to tell subprocesses to use a different specific pager. * lisp/startup.el (normal-top-level): Set PAGER to cat, if cat is available. (bug#72426) --- lisp/startup.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/startup.el b/lisp/startup.el index f18795ae6ac..738eec772ec 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -854,6 +854,12 @@ normal-top-level ;; We are careful to do it late (after term-setup-hook), although the ;; new multi-tty code does not use $TERM any more there anyway. (setenv "TERM" "dumb") + ;; Similarly, a subprocess should not try to invoke a pager, as most + ;; pagers will fail in a dumb terminal. Many programs default to + ;; using "less" when PAGER is unset, so set PAGER to "cat"; using cat + ;; as a pager is equivalent to not using a pager at all. + (when (executable-find "cat") + (setenv "PAGER" "cat")) ;; Remove DISPLAY from the process-environment as well. This allows ;; `callproc.c' to give it a useful adaptive default which is either ;; the value of the `display' frame-parameter or the DISPLAY value -- 2.39.3 --=-=-=--