diff --git a/tools/hxcpp/Log.hx b/tools/hxcpp/Log.hx index eb0d34f49..ab2956a7d 100644 --- a/tools/hxcpp/Log.hx +++ b/tools/hxcpp/Log.hx @@ -182,23 +182,19 @@ class Log if (colorSupported != true) { - colorSupported = Sys.getEnv("TERM_PROGRAM") == "iTerm.app" || Sys.getEnv("TERM_PROGRAM") == "Apple_Terminal"; + colorSupported = ~/(?i)-256(color)?$/.match(term) + || ~/(?i)^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/.match(term) + || (colorTerm != null); } if (colorSupported != true) { - colorSupported = ~/(?i)-256(color)?$/.match(term); - } - - if (colorSupported != true) - { - colorSupported = ~/(?i)^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/.match(term) || (colorTerm != null); - } - - if (colorSupported != true) - { - colorSupported = Sys.getEnv("COLORTERM") != null || Sys.getEnv("ANSICON") != null || Sys.getEnv("ConEmuANSI") != null - || Sys.getEnv("WT_SESSION") != null || Sys.getEnv("FORCE_COLOR") != null; + colorSupported = Sys.getEnv("TERM_PROGRAM") == "iTerm.app" + || Sys.getEnv("TERM_PROGRAM") == "Apple_Terminal" + || Sys.getEnv("COLORTERM") != null + || Sys.getEnv("ANSICON") != null + || Sys.getEnv("ConEmuANSI") != null + || Sys.getEnv("WT_SESSION") != null; } } }