Subject: bug#62958: [PATCH] Set PAGER=cat in comint.el

From: Juri Linkov <[email-masked]>
Date: Wed, 10 May 2023 19:39:12 +0300

>> Sorry, I don't understand: why would it matter that a program produces
>> its output immediately when that output is redirected to an Emacs
>> buffer?  Whatever the amount of output, the user can always page
>> through it interactively and conveniently using the normal movement
>> commands, no?  What am I missing?
>
> If the command produces a lot of output it can take a long time to run
> and slow down Emacs.

I will definitely customize the new option 'comint-pager' to "cat"
as soon as it arrives to master.  But for such cases when some
commands produce too long output, would it be also possible
to provide an additional option to set the number of lines
to output before stopping?

It seems not possible just to set the ENV variable 'LINES'.
>From 'man less':

  LINES  Sets the number of lines on the screen.  Takes precedence over the number  of
         lines  specified  by  the TERM variable.  (But if you have a windowing system
         which supports TIOCGWINSZ or WIOCGETD, the window system's idea of the screen
         size takes precedence over the LINES and COLUMNS environment variables.)

And indeed it has no effect when I tried.  Maybe because window size
adjustments are explicitly coded in 'window--adjust-process-windows'.