10

How do I increase the number of lines that I can view in screen?

I want to view the lines from the point when I ran screen -S <screen_name> to the current operation. For example, how would I increase the buffer length to around 50000 lines?

I have already tried ^a :scrollback <number> but it does not increases the lines I can reach in my current terminal.

neirbowj
  • 635
  • 5
  • 17
  • wont easiest be to use a tee or redirect (>) to save the results to a file ? and use less to view the file ? – gnuyoga Jun 26 '13 at 12:00
  • Removed reference to PuTTY because it doesn't appear to be relevant to the question. @gnuyoga: `screen` can also log any window to a file with the `logfile ` (default: `screen.log`) and `log` (toggle on/off) commands. – neirbowj Feb 24 '14 at 04:15
  • Possible duplicate of [How do I increase the scrollback buffer in a running screen session?](https://stackoverflow.com/questions/8760346/how-do-i-increase-the-scrollback-buffer-in-a-running-screen-session) – v_2e Jun 27 '17 at 15:53

2 Answers2

12

You cannot retroactively increase the scrollback buffer length in the current session in order to recover old lines that have already been discarded. However, if you change the current scrollback parameter setting (C-a :scrollback <number>), it will add more space for future terminal output. You can also set the defscrollback parameter to affect the initial scrollback setting for new windows.

If you want to set the default for all windows of all new screen sessions, make a ~/.screenrc file with

defscrollback 50000

or, if you only want a big scrollback sometimes, put it in a separate file, like ~/screenrc-50k-scrollback and invoke screen like this:

screen -S <screen_name> -c ~/screenrc-50k-scrollback

Check the current scrollback buffer capacity with C-a i (the info command).

(22,1)/(25,40)+50000 +flow G0[BBBB] 0(bash)
               ^^^^^

Reference: GNU Screen manual, Scrollback section

neirbowj
  • 635
  • 5
  • 17
-1

I don't know if I understood correctly what you asked, but if so I think you can just increase the value of Lines of scrollback property you can find on the Window menu item on the left of your Session configuration.

wizard
  • 1,456
  • 1
  • 11
  • 20