From 0188ebad5649d4c698245a2fef9039e6155b5f22 Mon Sep 17 00:00:00 2001 From: matthijs Date: Thu, 20 Aug 2009 10:01:42 +0000 Subject: (svn r17227) -Feature [Unix]: Only use colorized error output on terminals. --- src/unix.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/unix.cpp b/src/unix.cpp index a58389387..ec4bb05ff 100644 --- a/src/unix.cpp +++ b/src/unix.cpp @@ -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 } -- cgit v1.2.3-54-g00ecf