Latest versions
Version 598 (released at the earliest in December 2021) introduces the --redraw-on-quit
switch to prevent clearing the screen. Although switches are enabled when starting less, if that switch wasn't enabled on less's startup, it is also possible to enable that feature after by simply typing --redraw-on-quit
. I don't have access to a version recent enough to test, but I have it from a most credible source that only typing the 4 first characters should also suffice.
A regular user who would want an even shorter key combination could also add an entry to the lesskey file.
Pre-2022 versions
Versions anterior to 598 can still achieve that thanks to the much older -X switch. From the manpage:
-X or --no-init
Disables sending the termcap initialization and deinitialization
strings to the terminal. This is sometimes desirable if the
deinitialization string does something unnecessary, like clearing the
screen.
This should be considered as a workaround, as it completely disables initialization, which can cause keys (like Home and End) to stop working.
more
would not be suitable?