mirror of https://github.com/OpenTTD/OpenTTD
(svn r17227) -Feature [Unix]: Only use colorized error output on terminals.
parent
91aaf8350b
commit
0188ebad56
|
@ -222,7 +222,10 @@ void ShowOSErrorBox(const char *buf, bool system)
|
|||
ShowMacDialog( buf, "See readme for more info\nMost likely you are missing files from the original TTD", "Quit" );
|
||||
#else
|
||||
/* all systems, but OSX */
|
||||
fprintf(stderr, "\033[1;31mError: %s\033[0;39m\n", buf);
|
||||
if (isatty(fileno(stderr))) /* Only use escape codes on a TTY */
|
||||
fprintf(stderr, "\033[1;31mError: %s\033[0;39m\n", buf);
|
||||
else
|
||||
fprintf(stderr, "Error: %s\n", buf);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue