0

I'm using screen to leave processes running on a server through ssh. When I do screen -r, I do properly get back the terminal I left running previously, but I only see as much output as fits on my terminal window initially - I can't scroll up and see more of the output (the process I'm running prints a lot of stuff to console, so I am sure that there is more to see)

Is there any way to be able to see all the output, as I would be able to if I had just left the terminal window open instead of using screen?

e.g. Let's say I leave a for loop running that echos the numbers 1 through 1000. So 1000 lines will be printed to the console. (I also sleep for 10 second on each iteration so it's not instantaneous.) I then detach from my screen. When I resume my screen the next day, I want to be able to scroll up and see all 1000 echos, not just the last couple echos that fit on my terminal.

1
  • The default scrollback buffer size is 100 lines. You can set it higher.
    – meuh
    Jul 15, 2020 at 16:36

2 Answers 2

1

I don't exactly know what you are trying to do, but i assume you want this:

ctrl+a followed by [, followed by the up and down arrows.

(It's hard to see on many browsers, but the last key mentioned is opening square bracket)

4
  • It looks like that puts me into copy mode.... not sure what it does, but it doesn't let me scroll up any further in terminal output terminal which is what I'm hoping to do Jul 15, 2020 at 14:39
  • as for what I'm trying to do, let's say I leave a for loop running that echos the numbers 1 through 1000. so 1000 lines will be printed to the console. i then detatch from my screen. when I resume my screen, I want to be able to scroll up and see all 1000 echos, not just the last couple echos that fit on my screen Jul 15, 2020 at 14:40
  • In copy mode you can use your arrows or the page up/down keys to scroll up/down. There is a maximum buffer of 1000 lines, you can change this in /etc/screenrc
    – Garo
    Jul 16, 2020 at 8:21
  • I see now, thank you! Jul 16, 2020 at 13:11
0

If you detached the old screen session, and you attach a new one with a larger terminal size, you can force a screen redraw (if the runnning app is aware of them) with Ctrl-A, Z.

You must log in to answer this question.

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