或许在设置时您忽略了以下内容(可以看出您忽略了Tc
):
commit 427b8204268af5548d09b830e101c59daa095df9
Author: nicm <nicm>
Date: Fri Jan 29 11:13:56 2016 +0000
Support for RGB colour, using the extended cell mechanism to avoid
wasting unnecessary space. The 'Tc' flag must be set in the external
TERM entry (using terminal-overrides or a custom terminfo entry), if not
tmux will map to the closest of the 256 or 16 colour palettes.
Mostly from Suraj N Kurapati, based on a diff originally by someone else.
在tmux.conf中:
set-option -sa terminal-overrides ",xterm*:Tc"
在man手册中:
TERMINFO EXTENSIONS
tmux understands some unofficial extensions to terminfo(5):
...
Tc Indicate that the terminal supports the ‘direct colour’ RGB
escape sequence (for example, \e[38;2;255;255;255m).
If supported, this is used for the OSC initialize colour escape
sequence (which may be enabled by adding the ‘initc’ and ‘ccc’
capabilities to the tmux terminfo(5) entry).
关于
-s
和
-g
,
手册页面中写道:
set-option
[-agoqsuw] [-t target-session | target-window] option value
(别名: set)
使用-w设置窗口选项(等同于set-window-option命令),使用-s
设置服务器选项,否则设置会话选项。如果给出-g
,则设置全局会话或窗口选项。-u标志取消一个选项,这样会话就可以从全局选项继承该选项(或使用-g将全局选项恢复为默认值)。
-o标志防止设置已经设置的选项,-q标志抑制有关未知或模糊选项的错误。
使用-a
,如果选项需要字符串或样式,则将值附加到现有设置。
据我所知,使用
-s
意味着新连接(由服务器创建)将获得此设置,这在shell初始化中很有用,而
-g
使其更改过晚,无法在shell初始化时生效。
进一步阅读:
alias tmux='tmux -2'
解决了这个问题。 - jaaq