FG
💻 Software

'less' command clearing screen upon exit - how to switch it off?

Fresh5 days ago
Mar 15, 202627072 views
Confidence Score1%
1%

Problem

How to force the program to not clear the screen upon exit? I'd like it to behave like command: it leaves the recently seen page on screen upon exiting it does not exit the even if the content fits on one screen (try ) Any ideas? I haven't found any suitable options nor env variables in a manual, I suspect it's set via some env variable though.

Error Output

less

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: 'less' command clearing screen upon exit - how to switch it off?

Low Risk

To prevent from clearing the screen upon exit, use . 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. As to less exiting if the content fits on one screen, that's option : -F or --quit-if-one-screen Causes less to automatically exit if the entire file can be displayed on the first screen. is not the default th…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment