13

I do the following:

  1. Open Terminal.app
  2. Open a ssh session to a remote Linux server
  3. Open a screen session on the server
  4. 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…

grg
  • 136
  • 8
Max
  • 465
  • 2
  • 6
  • 11
  • I 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 Nov 26 '10 at 14:25

6 Answers6

14

You can modify .screenrc to allow mouse-based scrollback:

http://slaptijack.com/system-administration/mac-os-x-terminal-and-gnu-screen-scrollback/

growse
  • 8,020
  • 13
  • 74
  • 115
Anonymous
  • 141
  • 1
  • 2
10

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.

Prisoner
  • 316
  • 1
  • 17
  • +1 for that. Ignore my comment, I somehow managed to blank the part that mentioned screen... – SmallClanger Nov 26 '10 at 14:44
  • @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. – Dennis Williamson Nov 26 '10 at 15:20
6

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).

mark
  • 2,365
  • 14
  • 11
  • The 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. – jgoldschrafe Nov 29 '10 at 19:42
3

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
Dennis Williamson
  • 62,149
  • 16
  • 116
  • 151
  • Apparently 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: http://www.rickycampbell.com/fix-osx-terminal-pgup-pgdn-home-and-end – ak2 Nov 26 '10 at 16:10
3

Ok, i got it:

Ctrl + A, ESC 

and then vim-like commands:

Ctrl + u or Ctrl + d
Max
  • 465
  • 2
  • 6
  • 11
0

Press Shift when scrolling the mouse ...

ohho
  • 1,005
  • 8
  • 19
  • 34