aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSpencer Baugh2024-08-06 12:39:37 -0400
committerEli Zaretskii2024-08-17 12:23:47 +0300
commit7811a7d38bb7cb303dc66efa02eb95e75a03f39d (patch)
tree25f2acde96d4f131ee211eaf8ab3c9312e85b9c8
parentebac13844294483f708bb92699ee7da7a1b2db21 (diff)
downloademacs-7811a7d38bb7cb303dc66efa02eb95e75a03f39d.tar.gz
emacs-7811a7d38bb7cb303dc66efa02eb95e75a03f39d.zip
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. Users 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)
-rw-r--r--lisp/startup.el6
1 files changed, 6 insertions, 0 deletions
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 @@ It is the default value of the variable `top-level'."
854 ;; We are careful to do it late (after term-setup-hook), although the 854 ;; We are careful to do it late (after term-setup-hook), although the
855 ;; new multi-tty code does not use $TERM any more there anyway. 855 ;; new multi-tty code does not use $TERM any more there anyway.
856 (setenv "TERM" "dumb") 856 (setenv "TERM" "dumb")
857 ;; Similarly, a subprocess should not try to invoke a pager, as most
858 ;; pagers will fail in a dumb terminal. Many programs default to
859 ;; using "less" when PAGER is unset, so set PAGER to "cat"; using cat
860 ;; as a pager is equivalent to not using a pager at all.
861 (when (executable-find "cat")
862 (setenv "PAGER" "cat"))
857 ;; Remove DISPLAY from the process-environment as well. This allows 863 ;; Remove DISPLAY from the process-environment as well. This allows
858 ;; `callproc.c' to give it a useful adaptive default which is either 864 ;; `callproc.c' to give it a useful adaptive default which is either
859 ;; the value of the `display' frame-parameter or the DISPLAY value 865 ;; the value of the `display' frame-parameter or the DISPLAY value