GNU bug report logs -
#72426
29.2.50; comint-pager doesn't affect async-shell-command
Previous Next
Reported by: Spencer Baugh <sbaugh <at> janestreet.com>
Date: Fri, 2 Aug 2024 18:36:01 UTC
Severity: normal
Found in version 29.2.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Spencer Baugh <sbaugh <at> janestreet.com>
>> Cc: Jim Porter <jporterbugs <at> gmail.com>, 72426 <at> debbugs.gnu.org
>> Date: Wed, 07 Aug 2024 11:05:47 -0400
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> >> Date: Tue, 6 Aug 2024 19:36:15 -0700
>> >> Cc: 72426 <at> debbugs.gnu.org
>> >> From: Jim Porter <jporterbugs <at> gmail.com>
>> >>
>> >> 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.
>
> As expected. The problem is that a Lisp program could let-bind this
> variable around a call to async-shell-command (or some other similar
> API), in which case a setting in startup.el will not catch that. But
> maybe we don't care, since a program whose stdout is not a console
> device will ignore PAGER anyway.
Yep - I think it's fine for the same reason it's fine to have TERM set
by default, even though it's ignored by programs whose stdout is a pipe.
This bug report was last modified 246 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.