在终端中留下tmux回滚(iTerm2)

chb*_*own 17 ssh gnu-screen tty iterm tmux

通常tmux只显示与终端当前显示的行数相同的输出.然后当我分离它时,它会清除所有内容.我知道如何看待回溯(ctrl+A,[,k,...),但我怎么可以配置TMUX只打印了所有输出终端,因为如果我不使用它呢?

我喜欢tmux因为我很难记住nohup某些任务,并且因为它使查看长时间运行作业的输出变得更容易.不过,我想能够更自然地查看其回溯,通过简单地滚动回在iTerm2.

或者,如果有办法做到这一点screen,我也可以使用它.

Rob*_*obM 36

iTerm2 build 1.0.0.20130302具有首选项,即使存在所谓的硬状态行,它也能够捕获回滚:

iTerm2首选项窗格

适合我,用tmuxv1.8 测试.


Rob*_*obM 6

我在Superuser.com上偶然发现了另一种解决方案:使用终端滚动条和tmux.将此添加到您的~/.tmux.conf:

# Pretend our terminal doesn't support alternative screens, and thus all text 
# should be placed into the scrollback buffer when it goes off the top of the 
# screen.
#
# https://superuser.com/questions/310251/use-terminal-scrollbar-with-tmux
set-option -ga terminal-overrides ',xterm*:smcup@:rmcup@'
Run Code Online (Sandbox Code Playgroud)

适用于gnome-terminalv3.4.1.1和tmuxv1.9