mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 16:40:18 +00:00
color_out_init: check if the output is terminal
In Windows, if output is not MSYS, check if output is a terminal and do not relay on setWinTermAnsiColors() returning true. + check for MSYS terminal first (avoids attempt to set ansi color on MSYS terminal) refers to #256
This commit is contained in:
@@ -135,7 +135,7 @@ bool color_output_init() {
|
||||
return false;
|
||||
}
|
||||
#ifdef _WIN32
|
||||
color_stdout = setWinTermAnsiColors(STD_OUTPUT_HANDLE) || isMsysPty(fileno(stdout));
|
||||
color_stdout = isMsysPty(fileno(stdout)) || (_isatty(fileno(stdout)) && setWinTermAnsiColors(STD_OUTPUT_HANDLE));
|
||||
#else
|
||||
color_stdout = isatty(fileno(stdout));
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user