Skip to content

Commit d0f7596

Browse files
committed
Simplified some things a bit.
1 parent 9aed36a commit d0f7596

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

tools/hxcpp/Log.hx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -189,23 +189,19 @@ class Log
189189

190190
if (colorSupported != true)
191191
{
192-
colorSupported = Sys.getEnv("TERM_PROGRAM") == "iTerm.app" || Sys.getEnv("TERM_PROGRAM") == "Apple_Terminal";
192+
colorSupported = ~/(?i)-256(color)?$/.match(term)
193+
|| ~/(?i)^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/.match(term)
194+
|| (colorTerm != null);
193195
}
194196

195197
if (colorSupported != true)
196198
{
197-
colorSupported = ~/(?i)-256(color)?$/.match(term);
198-
}
199-
200-
if (colorSupported != true)
201-
{
202-
colorSupported = ~/(?i)^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/.match(term) || (colorTerm != null);
203-
}
204-
205-
if (colorSupported != true)
206-
{
207-
colorSupported = Sys.getEnv("COLORTERM") != null || Sys.getEnv("ANSICON") != null || Sys.getEnv("ConEmuANSI") != null
208-
|| Sys.getEnv("WT_SESSION") != null || Sys.getEnv("FORCE_COLOR") != null;
199+
colorSupported = Sys.getEnv("TERM_PROGRAM") == "iTerm.app"
200+
|| Sys.getEnv("TERM_PROGRAM") == "Apple_Terminal"
201+
|| Sys.getEnv("COLORTERM") != null
202+
|| Sys.getEnv("ANSICON") != null
203+
|| Sys.getEnv("ConEmuANSI") != null
204+
|| Sys.getEnv("WT_SESSION") != null;
209205
}
210206
}
211207
}

0 commit comments

Comments
 (0)