Subject: bug#72426: 29.2.50; comint-pager doesn't affect async-shell-command

From: Spencer Baugh <[email-masked]>
Date: Wed, 07 Aug 2024 11:05:47 -0400

Eli Zaretskii <[email-masked]> writes:
>> Date: Tue, 6 Aug 2024 19:36:15 -0700
>> Cc: [email-masked]
>> From: Jim Porter <[email-masked]>
>> 
>> Just to be extra-sure, I tried using 'async-shell-command' to run "git 
>> log" with PAGER unset, and sure enough it tried to use "less" for 
>> paging, which didn't go very well. "PAGER=cat" was much better.
>
> Did you try with process-connection-type nil?

With process-connection-type nil, git will never run a pager (since like
many programs it checks whether stdout is a terminal before doing so).

So both:

(let ((process-connection-type nil)
      (process-environment (cons '("PAGER" "less") process-environment)))
  (async-shell-command "git log"))

and

(let ((process-connection-type nil)
      (process-environment (cons "PAGER" process-environment)))
  (async-shell-command "git log"))

behave identically.

Setting PAGER=cat is only necessary for process-connection-type=t.