How to scroll back in screen within a ssh session from OS X?
Solution 1
Ok, i got it:
Ctrl + A, ESC
and then vim-like commands:
Ctrl + u or Ctrl + d
Solution 2
You can modify .screenrc
to allow mouse-based scrollback:
http://slaptijack.com/system-administration/mac-os-x-terminal-and-gnu-screen-scrollback/
Solution 3
If you did a man screen
you can see the options available.
When in screen you can do the following:
CTRL+A
(release), [
You can then use the arrows to scroll around the window. To get out of scrolling you can do a CTRL+C
.
Solution 4
Nathan's got it right, though I've always been a fan of Ctrl+A
+ ESC
. ESC
is yet another way to get out of copy mode.
It is worth considering, however, that scrollback history has a size limit and if you really want to play it safe, it's generally better to either redirect output to a file (or pipe it to tee if you want screen output as well).
Solution 5
Besides using the scroll-back buffer in screen
, Terminal.app may respond to Shift-Page Up (perhaps Shift-Fn-Up-Arrow on a MacBook).
Another option would be something like:
your_prog 2>&1 | less
Related videos on Youtube
Max
Updated on September 17, 2022Comments
-
Max over 1 year
I do the following:
- Open Terminal.app
- Open a ssh session to a remote Linux server
- Open a screen session on the server
- Start a program who breaks with many lines of error reporting…
How can I scroll up to read that?
And no, fixing the program is not a solution for now…
-
SmallClanger over 13 yearsI could be wrong, but I don't think linux TTYs hold any history, themselves. When you're on a console TTY, you can page back up by using
Ctrl
+PgUp
, but I doubt that will work in your case. Terminal.app must be configurable to hold more than its default amount of history, though. (or is it too late for that?)
-
SmallClanger over 13 years+1 for that. Ignore my comment, I somehow managed to blank the part that mentioned screen...
-
Dennis Williamson over 13 years@SmallClanger: Not only that, but the OP mentioned OS X, not Linux. Besides, on Linux, gnome-terminal and xterm, among others, have scroll-back buffers. Try shift-pageup.
-
al_mota over 13 yearsApparently in Terminal.app plain PgUp and PgDn will access the scrollback buffer, whereas Shift+PgUp and Shift+PgDn have to be used to send those keys to the application instead: rickycampbell.com/fix-osx-terminal-pgup-pgdn-home-and-end
-
jgoldschrafe over 13 yearsThe scrollback is adjustable, though, using the defscrollback option in .screenrc. I typically keep mine set to 5000 lines, but sometimes I bump it up a bit.
-
Robert Calhoun almost 9 yearsThis works perfectly!