How do I increase the scrollback buffer in a running screen session?
Press Ctrl+A then : and then type
scrollback 10000
to get a 10000 line buffer, for example.
You can also set the default number of scrollback lines by adding
defscrollback 10000
to your ~/.screenrc
file.
To scroll (if your terminal doesn't allow you to by default), press Ctrl+A then Esc and then scroll (with the usual Ctrl+F for next page or Ctrl+A for previous page, or just with your mouse wheel / two-fingers). To exit the scrolling mode, just press Esc.
Another tip: Ctrl+A then I shows your current buffer setting.
As Already mentioned we have two ways!
Per screen (session) interactive setting
And it's done interactively! And take effect immediately!
CTRL + A followed by : And we type scrollback 1000000
And hit ENTER
You detach from the screen and come back! It will be always the same.
You open another new screen! And the value is reset again to default! So it's not a global setting!
And the permanent default setting
Which is done by adding defscrollback 1000000
to .screenrc
(in home)
defscrollback
and not scrollback
(def stand for default)
What you need to know is if the file is not created ! You create it !
> cd ~ && vim .screenrc
And you add defscrollback 1000000
to it!
Or in one command
> echo "defscrollback 1000000" >> .screenrc
(if not created already)
Taking effect
When you add the default to .screenrc
! The already running screen at re-attach will not take effect! The .screenrc
run at the screen creation! And it make sense! Just as with a normal console and shell launch!
And all the new created screens will have the set value!
Checking the screen effective buffer size
To check type CTRL + A followed by i
And The result will be as
Importantly the buffer size is the number after the + sign
(in the illustration i set it to 1 000 000)
Note too that when you change it interactively! The effect is immediate and take over the default value!
Scrolling
CTRL+ A followed by ESC (to enter the copy mode).
Then navigate with Up,Down or PgUp PgDown
And ESC again to quit that mode.
(Extra info: to copy hit ENTER to start selecting! Then ENTER again to copy! Simple and cool)
Now the buffer is bigger!
And that's sum it up for the important details!
The man page explains that you can enter command line mode in a running session by typing Ctrl+A, :, then issuing the scrollback <num>
command.