I've configured really sweet keystrokes for switching between, and scrolling in, a tty (the Linux console). But, as soon as I change from one tty to another (or, from X to a tty), I cannot scroll anymore!

But, scrolling still "works", since, if I enter a new command, I can scroll that output (in addition to the output not "lost" when I returned to the tty, i.e., what was left on the screen when I changed in the first place).

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

+1 One of the most annoying limitations of Linux VTs (I'm not aware of any way to avoid it) and another good reason to use GNU screen or equivalent.
–
Stéphane ChazelasNov 8 '12 at 21:56

@StephaneChazelas: Do you know where the history is stored? Is this in a file or a data structure? Maybe I could bind some save-and-store scheme to my "switch tty" shortcuts... But, got it to work with screen, thanks.
–
Emanuel BergNov 8 '12 at 23:45

1

VGA (-compatible) cards can have several "pages" if you aren't using the card at its full resolution. Scrolled-out text is just stored there, in the video memory's free pages. It is of course wiped out when you switch to another terminal, or else you would have the incorrect scrollback.
–
angusNov 9 '12 at 0:46

1

FreeBSD doesn't have this problem, each VT has it's own scrollback buffer I am guessing.
–
MarcinNov 9 '12 at 16:57

Yes, scrollback data is cleared, that much is... clear. Do you know, is the data stored in a kernel data structure? Could it be saved to a file, and then restored, in much the same way as the context switch of multiprocessing?
–
Emanuel BergNov 9 '12 at 19:41

1

The kernel could do that, yes, but it doesn't, nor does it provide any way for you to get at that data from outside the kernel. You could change the kernel, of course.
–
Jim ParisNov 9 '12 at 20:45

1

Apparently somebody wrote a patch for that, but it wasn't accepted. So, AFAIK, the kernel still only preserves the visible console area.
–
angusNov 9 '12 at 21:14

Well, there you go, apply that patch and you're all set :)
–
Jim ParisNov 9 '12 at 22:04