Fix garbled log output in Xcode terminal

This commit is contained in:
vit9696 2021-09-19 12:26:55 +03:00
parent fc18a171a7
commit eb89c9be1e

View file

@ -69,6 +69,10 @@ ConsoleListener::ConsoleListener() : bHidden(true)
bUseColor = false;
#elif defined(_MSC_VER)
bUseColor = false;
#elif defined(__APPLE__)
// Xcode builtin terminal used for debugging does not support colours.
// Fortunately it can be detected with a TERM env variable.
bUseColor = isatty(fileno(stdout)) && getenv("TERM") != NULL;
#else
bUseColor = isatty(fileno(stdout));
#endif