]> granicus.if.org Git - jq/commitdiff
Configure whether colour is displayed by default directly in source
authorStephen Dolan <mu@netsoc.tcd.ie>
Wed, 8 May 2013 18:36:52 +0000 (19:36 +0100)
committerStephen Dolan <mu@netsoc.tcd.ie>
Wed, 8 May 2013 18:37:12 +0000 (19:37 +0100)
configure.ac
main.c

index b16f403b95bb58e05386a7b48432e46324f418f1..c42425d981d44118e4b9ce40b46a5283004793a8 100644 (file)
@@ -45,4 +45,3 @@ AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
 
 
-dnl FIXME should disable colour output on windows somehow
diff --git a/main.c b/main.c
index 4b0d496d9c1671bf9b63ea40140092fd05c74e29..774dc61e0d6ef6918d0dcfacf0b91d81c6589de3 100644 (file)
--- a/main.c
+++ b/main.c
@@ -74,8 +74,10 @@ static void process(jv value, int flags) {
       jv_free(result);
     } else {
       int dumpopts;
-#ifdef JQ_DEFAULT_ENABLE_COLOR
-      dumpopts = JQ_DEFAULT_ENABLE_COLOR ? JV_PRINT_COLOUR : 0;
+      /* Disable colour by default on Windows builds as Windows
+         terminals tend not to display it correctly */
+#ifdef WIN32
+      dumpopts = 0;
 #else
       dumpopts = isatty(fileno(stdout)) ? JV_PRINT_COLOUR : 0;
 #endif