如何增加 tmux 中的回滚缓冲区大小? [英] How to increase scrollback buffer size in tmux?
问题描述
如何在 tmux
中增加回滚缓冲区大小?
How do I increase scrollback buffer size in tmux
?
如果我进入复制模式,可用的回滚行数(在右上角可见)总是低于 2000.我试图找到所有 tmux 命令的列表,但我找不到任何关于回滚大小的信息.对于所有我看到的 用于设置该选项的 screen
命令 不适用于 tmux
.
If I enter copy mode, the number of available scrollback lines (visible in upper right corner) is always below 2000. I tried to find a list of all tmux commands, but I can't find anything about scrollback size. For all I see the screen
command for setting that option doesn't work with tmux
.
使用 tmux
1.8,Ubuntu 12.04 LTS,konsole
或 gnome-terminal
.
Using tmux
1.8, Ubuntu 12.04 LTS, either konsole
or gnome-terminal
.
推荐答案
历史限制是一个窗格属性,在创建窗格时固定,不能为现有窗格更改.该值取自 history-limit
会话选项(默认值为 2000).
The history limit is a pane attribute that is fixed at the time of pane creation and cannot be changed for existing panes. The value is taken from the history-limit
session option (the default value is 2000).
要创建具有不同值的窗格,您需要在创建窗格之前设置适当的 history-limit
选项.
To create a pane with a different value you will need to set the appropriate history-limit
option before creating the pane.
要建立不同的默认值,您可以在 .tmux.conf
文件中添加如下一行:
To establish a different default, you can put a line like the following in your .tmux.conf
file:
set-option -g history-limit 3000
注意:设置一个非常大的默认值时要小心,如果你创建很多窗格,它很容易消耗大量内存.
Note: Be careful setting a very large default value, it can easily consume lots of RAM if you create many panes.
对于现有会话中的新窗格(或新窗口中的初始窗格),您可以设置该会话的 history-limit
.您可能会使用这样的命令(来自 shell):
For a new pane (or the initial pane in a new window) in an existing session, you can set that session’s history-limit
. You might use a command like this (from a shell):
tmux set-option history-limit 5000 \; new-window
对于(初始窗口的初始窗格)新会话,您需要在创建会话之前设置全局"history-limit
:
For (the initial pane of the initial window in) a new session you will need to set the "global" history-limit
before creating the session:
tmux set-option -g history-limit 5000 \; new-session
注意:如果您不重新设置history-limit
值,那么新值也将用于以后创建的其他窗格/窗口/会话;目前没有直接的方法来创建具有自己特定限制的单个新窗格/窗口/会话而不(至少暂时)更改 history-limit
(尽管 show-option
(尤其是在 1.7 及更高版本中)可以帮助检索当前值,以便您以后恢复它).
Note: If you do not re-set the history-limit
value, then the new value will be also used for other panes/windows/sessions created in the future; there is currently no direct way to create a single new pane/window/session with its own specific limit without (at least temporarily) changing history-limit
(though show-option
(especially in 1.7 and later) can help with retrieving the current value so that you restore it later).
这篇关于如何增加 tmux 中的回滚缓冲区大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!