From 8447e1533afbd9a1c08fb434ada4e2b3408cb689 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 28 Jan 2021 22:30:41 +0800 Subject: fix color for win10 --- xmake/core/base/tty.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmake/core/base/tty.lua b/xmake/core/base/tty.lua index fd7de2175..1b257866a 100644 --- a/xmake/core/base/tty.lua +++ b/xmake/core/base/tty.lua @@ -40,7 +40,7 @@ end -- get colorterm setting -- --- COLORTERM: 8color, 256color, truecolor, nocolor +-- COLORTERM: 8color/color8, 256color/color256, truecolor, nocolor -- function tty._colorterm() local colorterm = tty._COLORTERM @@ -276,7 +276,7 @@ function tty.has_color256() local colorterm = tty._colorterm() if colorterm == "nocolor" then has_color256 = false - elseif colorterm and colorterm:find("256color", 1, true) then + elseif colorterm and (colorterm:find("256color", 1, true) or colorterm:find("color256", 1, true)) then has_color256 = true elseif tty.has_color24() then has_color256 = true @@ -289,7 +289,7 @@ function tty.has_color256() if has_color256 == nil then if term == "vstudio" then has_color256 = false - elseif term_env and term_env:find("256color", 1, true) then + elseif term_env and (term_env:find("256color", 1, true) or term_env:find("color256", 1, true)) then has_color256 = true end end -- cgit v1.3.1