]> git.cworth.org Git - apitrace/blobdiff - retrace/retrace_main.cpp
retrace: Implement glxCopySubBufferMESA
[apitrace] / retrace / retrace_main.cpp
index d1e00db3dd70eef7f651b85c18c9d4a452c0fe3c..bff8983b15a99becb7ac6dbe06ab58fcffcafdf5 100644 (file)
@@ -30,6 +30,9 @@
 #include <limits.h> // for CHAR_MAX
 #include <iostream>
 #include <getopt.h>
+#ifndef _WIN32
+#include <unistd.h> // for isatty()
+#endif
 
 #include "os_binary.hpp"
 #include "os_time.hpp"
@@ -751,6 +754,12 @@ int main(int argc, char **argv)
         }
     }
 
+#ifndef _WIN32
+    if (!isatty(STDOUT_FILENO)) {
+        dumpFlags |= trace::DUMP_FLAG_NO_COLOR;
+    }
+#endif
+
     retrace::setUp();
     if (retrace::profiling) {
         retrace::profiler.setup(retrace::profilingCpuTimes, retrace::profilingGpuTimes, retrace::profilingPixelsDrawn, retrace::profilingMemoryUsage);