2017-01-21 40 views
3

我現在使用TMUX了一段時間,TMUX - TMUX真彩工作不正常

我使用vim的編碼,而且我發現,只有當我使用vim與相關colorschemes一些瑕疵TMUX。

兩個終端支持256個色,當我運行此:tput的顏色

當我測試終端,看看是否支持真面目是這樣的結果:

curl -s https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh | bash 

來自終端的輸出是這樣的: enter image description here

但是當我TMUX內運行此: enter image description here

我檢查回聲$ TERM的結果,但他們兩人返回此:

xterm-256color 

所以我真的很困惑,什麼可能是這裏的問題= \

任何想法?

非常感謝!

回答

2

也許您設置忽略了這個(中可以看出,你忽略了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初始化。

延伸閱讀:

+2

能否請您解釋一下設置選項-sa終端重寫之間'的區別」,的xterm *:Tc「'和'set-option -ga terminal-overrides」,xterm-256color:Tc「'(這是大多數博客帖子似乎推薦的內容)到目前爲止您的摘要片段是'set-option -sa終端覆蓋「,xterm *:Tc」'是唯一對我有用的東西。 –