Scrollback on Linux TTY

11 points by hexo ↗ HN
Hi all, every time I use linux tty it is immense pain since they removed scrollback support in 5.9. I was wondering is there some brave soul who could bring us back this amazing feature that used to put linux upon any other system.

p.s. tmux or screen is not a solution.

7 comments

[ 2.7 ms ] story [ 28.2 ms ] thread
It was removed from vgacon + fbcon owing to security bugs and lack of maintainers to fix them. Linus said he is happy to reinstate it if you volunteer as maintainer.

Otherwise you could revert the removal in your own kernel, or else, kmscon still has scrollback: https://news.ycombinator.com/item?id=34154035

The thing is I oftentimes need to have it already in kernel by default and when I need it there is no way to install anything (i.e. non-working network), almost nothing installed, using less is a complete hell in these situations. Screen is very impractical for me to use, same with tmux. Kmscon isn't even in my distro (and the kmscon's idea isnt pretty at all - running a terminal right on top of another one just because we lost essential feature). Besides that it is needed when experiencing and dealing with bugs, system is locked up and i need to see the on-screen output - i.e. critical situations [yes this happened to me more than once in near past].

Thank you for tip and link!

Is this for the virtual consoles (the screens you get to with CTRL+ALT+F1..6)? If so is this for scrolling back to see errors that have been written the console, or for scrolling back once you've logged into the console?
Yes, for virtual consoles. And yes for scrolling back for errors and other stuff. For example - scrolling back to see previous output (or options from --help) while typing a command.

>>> for scrolling back once you've logged into the console

This, um, might pose security issue so, maybe excluding this?

Ok this is crude and really you would be better of learning to use screen or tmux, but you could always do the following.

login on your first virtual console and then run the following (feel free to replace bash with your preferred shell):

  bash | tee /tmp/scrollback

Then login on your second virtual console and run:

  less +F /tmp/scrollback

Now switch back to your first virtual console and start debugging. When you hit a point you want to scroll back then hop over to your second virtual console hit <CTRL>+C to interrupt less from following your file and you can then scroll back through your output. When you've done scrolling back through your history press <SHIFT>+F (i.e. an uppercase F) in less and it'll go back to following the /tmp/scrollback file

It's not how I would work, but there were times where I've had minimal resources to work with on a physical server and this did the job - albeit in a total impractical way. :)

>>>>>> for scrolling back once you've logged into the console

>>>This, um, might pose security issue so, maybe excluding this?

oh, this is wrong and makes no sense, because I was unable to read properly the other day... i've read "once you logged out"