« Back to home

Screen Scrollback Buffer

Posted on

I end up using GNU “screen” a lot.  It lets me SSH into my laptop, run something, then close the SSH connection with the task still running in the background.  Later I can SSH in and regain control of the task.  It’s helpful for Counter-Strike server admin, compiling stuff, or building a test corpus…

Anyway, screen interferes with the regular terminal’s ability to scroll back and view previous program output.  Today I found a description of how to fix that problem.  To set the scrollback buffer size:

Hit C-a (Ctrl-A) : to go to the Screen command line and type scrollback num, where num is the number of scrollback lines.

That’s Ctrl+A followed by a colon.  Or add a command to your ~/.screenrc file.  To view that scrollback buffer, go into screen’s “copy mode”:

To enter scrollback hit C-a [. A status line will indicate that you’ve entered copy mode. To exit scrollback mode, hit the escape button.

He also lists some navigation commands for copy mode, but the arrow keys work fine for me (call me a philistine if you wish).