mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 15:40:21 +00:00
log_msg: do not use colors in MSYS2 terminal
MSYS2 pseudoterminal doesn't handle MSW terminal colors, it uses POSIX colors instead.
This commit is contained in:
@@ -158,7 +158,8 @@ void log_msg(int level, const char *format, ...)
|
||||
#ifdef WIN32
|
||||
if (color_win != 0u) {
|
||||
con = GetStdHandle(STD_ERROR_HANDLE);
|
||||
no_color = con == INVALID_HANDLE_VALUE || getenv("NO_COLOR");
|
||||
no_color = con == INVALID_HANDLE_VALUE || getenv("NO_COLOR")
|
||||
|| (getenv("TERM") && strcmp(getenv("TERM"), "xterm") == 0); // MSYS2 pseudoterminal
|
||||
if (!no_color) {
|
||||
GetConsoleScreenBufferInfo(con, &con_info);
|
||||
SetConsoleTextAttribute(con, ((con_info.wAttributes) & 0xF0) | color_win);
|
||||
|
||||
Reference in New Issue
Block a user