How to scroll up in terminal window while new input is generated without being thrown back to the bottom (Linux)

Although I'm a bit late, I'm posting this here so that anyone who comes here gets a solution. For me, the solution to the same problem was:

Terminator preferences -> Profiles Tab -> Scrolling [sub]tab -> Uncheck 'Scroll on output' option.

The good thing about this option, is that it will still scroll on output when you are at the very bottom of the output, but as soon as you scroll up, it will stop and won't bother you even if output content is still being generated.

I hope this helps


tail -f log.txt | less will update to advance to the new information, and you can then go up or down. You can also use less search features and so on. With the pipe method, you can also parse the moving output.

And the same idea, but without the pipe : less +F log.txt .
(This assumes you can work with your content in this fashion.)

The old Unix way was to hit Ctrl-S in your terminal to stop, and Ctrl-Q to restart output scrolling -- this is basically what terminator is letting you do with stty ixon.
With scrollbars added, this seems pretty decent to me -- hit Control-S, scroll up to whatever you like, and then Control-Q to go back down. Yes, you will occasionally forget to unpause the output.

Because I'm exceptionally lazy, and because I like the flexibility of output redirection, I'd use tail -f with the pipe (assuming that fits the case) . Then I can stop it, arrow-up and add something like a grep, and it still runs: tail -f tac_plus.log | less | egrep 'peerip'

Throw some cats and tee in there and you have a real party.

Tags:

Linux

Terminal