diff options
| author | ruki <[email protected]> | 2021-01-28 22:30:41 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-01-28 22:30:41 +0800 |
| commit | 8447e1533afbd9a1c08fb434ada4e2b3408cb689 (patch) | |
| tree | 85aa80f1ecec30e23b9844481e8a6282da8b02e0 /xmake/core/base/tty.lua | |
| parent | 78f4c8488e667007886bc1e02ac80444d6d42ea4 (diff) | |
fix color for win10
Diffstat (limited to 'xmake/core/base/tty.lua')
| -rw-r--r-- | xmake/core/base/tty.lua | 6 |
1 files 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 |
