diff options
| -rw-r--r-- | xmake/core/base/colors.lua | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/xmake/core/base/colors.lua b/xmake/core/base/colors.lua index d3d386011..4071f636f 100644 --- a/xmake/core/base/colors.lua +++ b/xmake/core/base/colors.lua @@ -432,14 +432,12 @@ end -- ignore all colors function colors.ignore(str) - - -- check string - if not str then - return nil + if str then + -- strip "${red}" and "${theme color}" + str = colors.translate(str, {plain = true}) + -- strip color code, e.g. for clang/gcc color diagnostics output + return (str:gsub("\x1b%[.-m", "")) end - - -- ignore it - return colors.translate(str, {plain = true}) end -- get theme |
