diff options
-rw-r--r-- | cmake.deps/CMakeLists.txt | 4 | ||||
-rw-r--r-- | runtime/lua/nvim/health.lua | 31 | ||||
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 7 |
3 files changed, 25 insertions, 17 deletions
diff --git a/cmake.deps/CMakeLists.txt b/cmake.deps/CMakeLists.txt index 444428826a..8844613655 100644 --- a/cmake.deps/CMakeLists.txt +++ b/cmake.deps/CMakeLists.txt @@ -168,8 +168,8 @@ set(UNIBILIUM_SHA256 29815283c654277ef77a3adcc8840db79ddbb20a0f0b0c8f648bd8cd49a set(LIBTERMKEY_URL https://www.leonerd.org.uk/code/libtermkey/libtermkey-0.22.tar.gz) set(LIBTERMKEY_SHA256 6945bd3c4aaa83da83d80a045c5563da4edd7d0374c62c0d35aec09eb3014600) -set(LIBVTERM_URL https://www.leonerd.org.uk/code/libvterm/libvterm-0.3.tar.gz) -set(LIBVTERM_SHA256 61eb0d6628c52bdf02900dfd4468aa86a1a7125228bab8a67328981887483358) +set(LIBVTERM_URL https://www.leonerd.org.uk/code/libvterm/libvterm-0.3.1.tar.gz) +set(LIBVTERM_SHA256 25a8ad9c15485368dfd0a8a9dca1aec8fea5c27da3fa74ec518d5d3787f0c397) set(LUV_VERSION 1.44.2-1) set(LUV_URL https://github.com/luvit/luv/archive/80c8c00baebe3e994d1616d4b54097c2d6e14834.tar.gz) diff --git a/runtime/lua/nvim/health.lua b/runtime/lua/nvim/health.lua index e11574ee97..b76106f241 100644 --- a/runtime/lua/nvim/health.lua +++ b/runtime/lua/nvim/health.lua @@ -273,7 +273,7 @@ local function check_tmux() if tmux_esc_time ~= 'error' then if empty(tmux_esc_time) then health.report_error('`escape-time` is not set', suggestions) - elseif tmux_esc_time > 300 then + elseif tonumber(tmux_esc_time) > 300 then health.report_error( '`escape-time` (' .. tmux_esc_time .. ') is higher than 300ms', suggestions @@ -326,17 +326,24 @@ local function check_tmux() end -- check for RGB capabilities - local info = vim.fn.system({ 'tmux', 'show-messages', '-JT' }) - local has_tc = vim.fn.stridx(info, ' Tc: (flag) true') ~= -1 - local has_rgb = vim.fn.stridx(info, ' RGB: (flag) true') ~= -1 - if not has_tc and not has_rgb then - health.report_warn( - "Neither Tc nor RGB capability set. True colors are disabled. |'termguicolors'| won't work properly.", - { - "Put this in your ~/.tmux.conf and replace XXX by your $TERM outside of tmux:\nset-option -sa terminal-overrides ',XXX:RGB'", - "For older tmux versions use this instead:\nset-option -ga terminal-overrides ',XXX:Tc'", - } - ) + local info = vim.fn.system({ 'tmux', 'display-message', '-p', '#{client_termfeatures}' }) + info = vim.split(vim.trim(info), ',', { trimempty = true }) + if not vim.tbl_contains(info, 'RGB') then + local has_rgb = false + if #info == 0 then + -- client_termfeatures may not be supported; fallback to checking show-messages + info = vim.fn.system({ 'tmux', 'show-messages', '-JT' }) + has_rgb = info:find(' Tc: (flag) true', 1, true) or info:find(' RGB: (flag) true', 1, true) + end + if not has_rgb then + health.report_warn( + "Neither Tc nor RGB capability set. True colors are disabled. |'termguicolors'| won't work properly.", + { + "Put this in your ~/.tmux.conf and replace XXX by your $TERM outside of tmux:\nset-option -sa terminal-features ',XXX:RGB'", + "For older tmux versions use this instead:\nset-option -ga terminal-overrides ',XXX:Tc'", + } + ) + end end end diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 228aaa6b23..55bf50e2e0 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -1298,6 +1298,7 @@ describe('TUI', function() [7] = {reverse = true, foreground = Screen.colors.SeaGreen4}, [8] = {foreground = Screen.colors.SeaGreen4}, [9] = {bold = true, foreground = Screen.colors.Blue1}, + [10] = {foreground = Screen.colors.Blue}, }) feed_data(':hi SpecialKey ctermfg=3 guifg=SeaGreen\n') @@ -1318,9 +1319,9 @@ describe('TUI', function() feed_data(':set termguicolors\n') screen:expect([[ {7:^}{8:G} | - {9:~ }| - {9:~ }| - {9:~ }| + {9:~}{10: }| + {9:~}{10: }| + {9:~}{10: }| {3:[No Name] [+] }| :set termguicolors | {4:-- TERMINAL --} | |