19

I use screen as my window manager through putty. Screen has been great, but I need a way to increase my buffer when I run commands. I have no buffer when I scroll up, no std out is saved beyond my window size on any terminal.

How can I increase this I can't seem to find an option in the commands? Ctrl + a ? doesn't seem to have what I am looking for.

4 Answers 4

18

I actually figured this out after looking through the man page. Setting the screen buffer inside .screenrc does work, but you can change it inside your screen session.

Ctrl-a + : and typing

scrollback 1000

gives you a 1000 line buffer.

You can also set the default number of scrollback lines in .screenrc by using

defscrollback 1000

Then entering copy mode will let you scroll around.

2
  • The explicit instructions for .screenrc make this the most useful answer
    – rer
    Sep 6, 2018 at 14:11
  • 4
    It would be good to clarify even more explicitly that scrollback does not work in .screenrc, only defscrollback does. Jun 6, 2019 at 11:23
12

Do Ctrl + a : then enter scrollback 1234 sets your buffer to 1234 lines. You enter scrollback mode ("copy mode") with Ctrl + a Esc, then move in vi-style, leave copy mode with another Esc

1
  • Yes this definitely works, I just figured this out myself at the same time haha
    – ProdIssue
    Mar 13, 2017 at 14:23
3

You actually do have something of a buffer, but it's invisible to most terminal emulators (which is why e. g. scroll bars don't appear to work). One way to get at it is to enter copy mode (Ctrl-A,[ followed by arrow keys, PgUp, et cetera). The size of this buffer can be configured in .screenrc. You you an change its allocation inside your screen session:

Ctrl-a + : and typing

scrollback 1000

gives you a 1000 line buffer.

3
  • That definitely sounds like a solution I will try this, I use Ctrl + a, Esc to get into copy mode personally, but they both work
    – ProdIssue
    Mar 13, 2017 at 13:29
  • @DopeGhoti Yes you can in a running session like with other commands; see other answers
    – Philippos
    Mar 13, 2017 at 14:27
  • I noticed this. Updating my answer to incorporate this.
    – DopeGhoti
    Mar 13, 2017 at 15:42
3

If you want to change screen settings globally (for all users) then you can edit /etc/screenrc (Ubuntu). File path might be different on other distros.

In your case add the following lines to the file:

# define a bigger scrollback, default is 100 lines
defscrollback 1024

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .