Hello I am working on a raspberry pi with Raspian version 10 (buster), and I recently installed GNU Screen version 4.06.02. When I used to look at files with less, the contents would appear on what seemed like a different screen, so that when I exited out with 'q' I would return to my base terminal view. Now when I use less with screen it works like a weird cat command, showing my base terminal and the contents of the file underneath. When I fully close the terminal and SSH back into my pi, less works like normal. I haven't been able to find anybody with the same issue, and I don't even know where to start looking in order to fix this, any help would be appreciated.


The setting you're probably looking for is altscreen. This is an optional feature (not all physical terminals support it).

This can be turned on by adding the line altscreen on in $HOME/.screenrc. Now when screen starts up it will enable the behavior you want.

In the current session you can to Control a :altscreen on to enable it immediately.

  • This answer is a bit confusing. The first paragraph suggests that GNU screen won't be able to implement alternate screen switching in the emulated pseudo-terminals unless the outer "physical" terminal it runs itself in supports alternate screen switching. That's not true. I suggest changing it to: What you're looking for is "alternate screen switching", an optional feature not implemented in all terminals. GNU screen supports it, but it's disabled by default. You can enable it with "altscreen on", etc, etc.
    – user414777
    Sep 11 '20 at 19:04
  • The answer is at best misleading: screen simulates the alternate-screen feature, rather than relying upon the terminal. To see that, you have to read the manual page. Mar 24 at 23:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.