How to Increase the Scrollback Buffer in a Running Screen Session

How do I increase the scrollback buffer in a running screen session?

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.

How do I increase the scrollback buffer size in tmux?

The history limit is a pane attribute that is fixed at the time of pane creation and cannot be changed for existing panes. The value is taken from the history-limit session option (the default value is 2000).

To create a pane with a different value you will need to set the appropriate history-limit option before creating the pane.

To establish a different default, you can put a line like the following in your .tmux.conf file:

set-option -g history-limit 3000

Note: Be careful setting a very large default value, it can easily consume lots of RAM if you create many panes.

For a new pane (or the initial pane in a new window) in an existing session, you can set that session’s history-limit. You might use a command like this (from a shell):

tmux set-option history-limit 5000 \; new-window

For (the initial pane of the initial window in) a new session you will need to set the “global” history-limit before creating the session:

tmux set-option -g history-limit 5000 \; new-session

Note: If you do not re-set the history-limit value, then the new value will be also used for other panes/windows/sessions created in the future; there is currently no direct way to create a single new pane/window/session with its own specific limit without (at least temporarily) changing history-limit (though show-option (especially in 1.7 and later) can help with retrieving the current value so that you restore it later).

GNU screen: how to check current scrollback value?

As soon as you enter scrollback mode (CtrlA then Esc), you should see a status line like

Copy mode - Column 71 Line 25(+3000) (80,25)

The 3000 is the scrollback size. As long as you're in scrollback mode, you can use CtrlG to see a shorter version of that status line. If you're no longer at the bottom, the +3000 will be changed to show how far you've scrolled back. It tells how many lines are available above the currently displayed region, so +0 means you've scrolled back all the way.

Linux screen command scrollback one screen

Working as intended. The cursor starts out at the bottom of the current page; pressing Ctrl+B moves it up to the top of the page, plus one line (just as if you'd pressed 25 times, or however many rows are on your screen).

Copying the GNU screen scrollback buffer to a file (extended hardcopy)

To write the entire contents of the scrollback buffer to a file, type

Ctrl + A and :
to get to command mode, then

hardcopy -h <filename>

In older versions of screen, if you just do hardcopy -h, it just writes to the file -h. This was fixed in version 4.2.0, so hardcopy -h writes to hardcopy.N where N is the current window number.



Related Topics



Leave a reply



Submit