This provides an alternative way to set the number of lines per screenful, with the same
effect as the '-n' and '--lines' command line options.
[kzak@redhat.com: - use ul_strtou16()]
Addresses: #3476
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Signed-off-by: Karel Zak <kzak@redhat.com>
Run *more* in "secure" mode. See SECURITY for details.
*PAGERSECURE*::
-Equivalent to MORESECURE.
+Equivalent to MORESECURE.
+
+*MORE_SHELL_LINES*::
+Specify the _number_ of lines per screenful. It has the same effect as the '-n' and '--lines' options. See in OPTIONS for details. Also, note that the environment variable's value will be overridden if any of these options are set.
== HISTORY
Modified by John Foderaro, UCB to add -c and MORE environment variable.
-Modified by Christian Goeschel Ndjomouo to add MORESECURE and PAGERSECURE environment variables, and a SECURITY section
+Modified by Christian Goeschel Ndjomouo to add MORESECURE, PAGERSECURE and MORE_SHELL_LINES environment variables, and a SECURITY section
== SEE ALSO
* 2010-10-21 Davidlohr Bueso <dave@gnu.org>
* modified mem allocation handling for util-linux
* 2025-04-03 Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
- * modified to add MORESECURE and PAGERSECURE environment variables
+ * modified to add MORESECURE, PAGERSECURE and MORE_SHELL_LINES environment variables
*/
#include <stdio.h>
if (getenv("MORESECURE") || getenv("PAGERSECURE"))
ctl.is_secure = 1;
+ if ((s = getenv("MORE_SHELL_LINES")) && isdigit_string(s))
+ ul_strtou16(s, (uint16_t *) &ctl.lines_per_screen, 10);
+
if ((s = getenv("MORE")) != NULL)
env_argscan(&ctl, s);