How can I view more of my history in Screen on Linux?
I was running scripts overnight from the command line (inside Screen on a Linux EC2 instance) and some errors that I was not tracking occurred. I want to "scroll up" or view more of the history in Screen, but I cannot seem to find any commands that will work.
I need to see the onscreen output "further up" than I can on my current screen. CTRL + a is supposed to put me into scroll mode inside Screen, but it's not working.
When you start screen you can specify the size of the scrollback buffer with -h, so you can increase it from the default of 100 lines. However, with a currently running screen, once the data has left the buffer, it is gone.
Assuming you haven't overriden your escape sequence, you can press Ctrl-a [
to go into scrollback mode, then use the usual Page-UP/Page-DOWN or Ctrl-b/Ctrl-f to go up and down.
From the Gentoo wiki on Screen usage
I need to see the onscreen output "further up" than I can on my current screen. CTRL + a is supposed to put me into scroll mode inside Screen, but it's not working.
In complement to the other answers, I would point out that you may add in your ~/.screenrc
file:
defscrollback 100000
termcapinfo xterm ti@:te@
where:
-
defscrollback 100000
: set the default number of scrollback lines to100000
-
termcapinfo xterm ti@:te@
: allow terminal scrolling in either xterm or PuTTY. (screen FAQ; PuTTY FAQ)
You can also change the scrollback history size in a running screen with the sequence CTRL-a
:
(enter screen command-line mode), then scrollback 10000
if you want 10k lines of history buffer. The change applies immediately.
Be careful of memory usage if you use many screens with very long buffers.
However, like @William Pursell said, with a currently running screen, once the data has left the buffer, it is gone.