也許您設置忽略了這個(中可以看出,你忽略了Tc
):在tmux.conf
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.
:
# Enable RGB colour if running in xterm(1)
set-option -sa terminal-overrides ",xterm*:Tc"
在手冊頁:
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
,在manual page說:
set-option
[-agoqsuw] [-t目標會話|目標窗口]選項值 (別名:集)
設置與-w一個窗口的選項(相當於 設定窗口選項命令),一個服務器選項與-s
,否則 會話選項。如果給出-g
,則設置全局會話或窗口 選項。 -u標誌取消設置選項,因此會話 繼承全局選項中的選項(或使用-g, 將全局選項恢復爲默認選項)。
-o標誌防止設置已經設置的選項,並且-q標誌抑制關於未知或含糊不清的 選項的錯誤。
隨着-a
,如果選項需要一個字符串或樣式,價值 是附加到現有的設置。
據我瞭解, 使用-s
意味着新的連接(由服務器創建)將獲得此設置,這是在shell初始化有用的,而-g
使其改變爲時太晚shell初始化。
延伸閱讀:
能否請您解釋一下設置選項-sa終端重寫之間'的區別」,的xterm *:Tc「'和'set-option -ga terminal-overrides」,xterm-256color:Tc「'(這是大多數博客帖子似乎推薦的內容)到目前爲止您的摘要片段是'set-option -sa終端覆蓋「,xterm *:Tc」'是唯一對我有用的東西。 –