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.

3
  • 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, 2013 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 <filename> (default: screen.log) and log (toggle on/off) commands.
    – neirbowj
    Feb 24, 2014 at 4:15
  • Possible duplicate of How do I increase the scrollback buffer in a running screen session?
    – v_2e
    Jun 27, 2017 at 15:53

2 Answers 2

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

2
  • for me, on Debian Jessie/testing with screen 4.4, the option in .screenrc is scrollback 50000
    – daks
    Sep 24, 2016 at 10:55
  • defscrollback for me on Ubuntu 16.04.3 LTS Dec 28, 2017 at 1:09
-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.

1
  • The question was modified, my answer was related to original question.
    – wizard
    Feb 23, 2016 at 10:21

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.