I use multiple terminal sessions and my device can't be constantly online so naturally I need GNU screen.

But typing Ctrl-a <escape> a million times a day was killing me! Then I finally discovered the setting to make scrolling "just work".

Make scrolling work in GNU screen

Add this line to ~/.screenrc:

termcapinfo xterm* ti@:te@ 

Screen then stops using the alternate screen, so scrolling uses your terminal's own scrollback. The xterm* pattern must match your terminal. Check with echo $TERM inside screen.

This probably also makes scrolling work in byobu and tmux as well, but I haven't tested those.

The other way to scroll in screen

For per-window scrollback: Press Ctrl-a [, then scroll with the arrow keys or Page Up and Page Down. Press Esc to leave.

To set its size, add this to ~/.screenrc:

defscrollback 10000