Reputation: 30301
Lets say I have a currently running screen session I am interacting with through putty. I've realized that the scrollback buffer is too small and would like to increase it without starting a new screen session.
Is there a way to do this?
Upvotes: 294
Views: 223387
Reputation: 81
WARNING: setting this value too high may cause your system to experience a significant hiccup. The higher the value you set, the more virtual memory is allocated to the screen process when initiating the screen session.
I set my ~/.screenrc to "defscrollback 123456789" and when I initiated a screen, my entire system froze up for a good 10 minutes before coming back to the point that I was able to kill the screen process (which was consuming 16.6GB of VIRT mem by then).
Upvotes: 8
Reputation: 22482
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 (lowercase) shows your current buffer setting.
Upvotes: 452
Reputation: 686
Put the defscrollback before additional windows are opened in your ~/.screenrc file, e.g.
# ===============================================================
# VARIABLES - Number values
# ===============================================================
defscrollback 10000 # default: 100
# ===============================================================
# STARTUP of programs in an extra window:
# ===============================================================
screen -t da 0
screen -t da 1
screen -t da 2
screen -t da 3
screen -t da 4
screen -t da 5
screen -t da 6
screen -t da 7
screen -t da 8
screen -t da 9
Otherwise, you will have only 1024 lines in the history buffer.
Upvotes: 0
Reputation: 20860
As Already mentioned we have two ways.
And it's done interactively, and takes 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!
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)
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 makes sense! Just as with a normal console and shell launch.
All the new created screens will have the set value.
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.
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.
Upvotes: 23
Reputation: 111
There is a minimal amount of "default" buffer when you startup a 'screen' session within your 'putty session'. I use screens a lot in my work, so I can tell you that you will not have a combination of 'screen' buffer & 'putty' buffer within your 'screen' session.
Setting the default number of scrollback lines by adding defscrollback 10000
to your ~/.screenrc
file is the correct solution.
By the way, I use "defscrollback 200000" in my ./screenrc
file.
Upvotes: 11
Reputation: 262919
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.
Upvotes: 204