-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
distinguish q & Q, let latter exit without clearing screen #36
Comments
The -X flag doesn't specifically suppress clearing the screen, it suppresses (both) the terminal init and deinit sequences. Normally the init sequence is sent when less starts and the deinit is sent just before it exits. If you were to enter less without -X, it would send the init sequence, and if you later chose to exit without sending the deinit sequence, the terminal could be left in an inconsistent state (where arrow keys don't work correctly among other things). That's why -X is one of the few flags that can't be changed from within less. |
Could there be a mode where less always enters and exits the alternate screen, but upon doing so, the last printed page is also printed to the primary screen? Is something like that technically possible? This would fix the use case where a large file is scrolled through and its contents pollute the main screen, when what you really want preserved is what you last saw. EDIT: I realize this is not technically on-topic. Let me know if I should open a new issue. |
Added --redraw-on-quit option in d081e3e to redraw the final screen after switching back from alternate screen. You can make Q invoke this behavior by adding this line to your .lesskey file.
|
@gwsw there's a bug when combined with There are two bugs I see here:
|
Should be fixed in dd9a11a. |
Works great now, thanks! |
Hello, I'm interested in this feature, when do you plan on making a release with it? (on https://greenwoodsoftware.com/) |
@bew less-598 is now available for beta testing and includes this feature. |
Thank you very much @jimc , @gwsw and @mcornella Unfortunately this very useful option remains undocumented in the relevant FAQ entry. |
I've added a mention of --redraw-on-quit to the FAQ entry. |
Thank you @gwsw |
Ok, done. |
less has -XF options (iirc) that suppress clearing of screen on exit.
However, it is inconvenient to choose that before starting the browse.
ISTM it would be easy to assign different exit behavior (already possible)
to some of the :q command variations. My 1st try would prolly be to
assert those --options just before exit, but thats pure WAG.
The text was updated successfully, but these errors were encountered: