我现在正在使用tmux,
我使用vim进行编码,我注意到只有当我使用vim和tmux时才会出现与colorschemes相关的一些缺陷.
当我运行时,两个终端都支持256种颜色:tput colors
当我测试我的终端以查看是否支持真彩色时,这是结果:
curl -s https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh | bash
Run Code Online (Sandbox Code Playgroud)
我已经检查了echo $ TERM的结果但是它们都返回了这个:
xterm-256color
Run Code Online (Sandbox Code Playgroud)
所以我真的很困惑这里可能出现的问题=
任何的想法?
非常感谢!
Tho*_*key 19
也许你在设置中忽略了这一点(可以看出你忽略了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.
Run Code Online (Sandbox Code Playgroud)
在tmux.conf中:
# Enable RGB colour if running in xterm(1)
set-option -sa terminal-overrides ",xterm*:Tc"
Run Code Online (Sandbox Code Playgroud)
在联机帮助页中:
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).
Run Code Online (Sandbox Code Playgroud)
关于-s与-g中,手册页说:
set-option[-agoqsuw] [-t target-session | target-window]选项值(别名:set)
使用-w(相当于set-window-option命令)设置窗口选项,使用服务器选项-s,否则使用会话选项.如果-g给定, 则设置全局会话或窗口选项.-u标志取消设置选项,因此会话从全局选项继承选项(或使用-g,将全局选项恢复为默认选项).-o标志阻止设置已设置的选项,-q标志禁止有关未知或不明确选项的错误.
使用
-a,如果选项需要字符串或样式,则将值附加到现有设置.
据我所知,使用-s意味着新连接(由服务器创建)将获得此设置,这在shell初始化中很有用,同时-g使其更改为shell初始化太晚.
进一步阅读: