Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Leaving tmux scrollback in terminal (iTerm2)

Usually tmux will only show as much output as however many rows my terminal currently displays. And then when I detach it, it clears all of its content. I know how to look at scrollback (ctrl+A, [, k, ...), but how can I configure tmux to just print all its output to terminal, as if I wasn't using it at all?

I like tmux because I'm awful at remembering to nohup certain tasks, and because it makes viewing the output of long-running jobs easier. But I would like to be able to view its scrollback more naturally, by simply scrolling back in iTerm2.

Alternatively, if there's a way to do this in screen, I can use that too.

like image 519
chbrown Avatar asked Oct 12 '12 19:10

chbrown


People also ask

How do I exit tmux scroll?

Enable and Use the Scroll Mode of Tmux When a user is done with scrolling, he can get out of scroll mode in Tmux by pressing the Q key. If that did not work as per the expectations, then check if using the F7 key to enter the scroll mode and q to quit the mode solves the problem.

How do you use tmux on iTerm2?

The first key combination (ctrl+b) puts tmux into command mode. The percent tells tmux to split the window vertically. Even moving between the vertical panes takes two keyboard interactions. The first is ctrl+b which puts tmux into command mode.

How do I save my tmux output?

In order to save an entire tmux session, type prefix + Control + s .

How do I clear my tmux screen?

I use bash, so ctrl-l already does the equivalent of typing "clear" at the command line. With these two keys I get a nice ctrl-l, ctrl-k combo, which moves all the scroll buffer off the screen (the "clear") and then deletes all that history (the tmux "clear-history" command).


1 Answers

iTerm2 build 1.0.0.20130302 has an preference which enables it to capture scrollback even when a so-called hard status line is present:

iTerm2 preferences pane

Works for me, tested with tmux v1.8.

like image 142
RobM Avatar answered Oct 03 '22 20:10

RobM