aboutsummaryrefslogtreecommitdiff
path: root/tomo.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-04-20 14:24:37 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-04-20 14:24:37 -0400
commite33aff908b77f43309e61634985c03551ab9cd10 (patch)
tree2a220fb46ce838d78e75fdaea0da092200c1031a /tomo.c
parente79ce52125875e17ac0b460dfff07a8ecca63676 (diff)
Inline color file
Diffstat (limited to 'tomo.c')
-rw-r--r--tomo.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tomo.c b/tomo.c
index 054b9e44..a2acdc29 100644
--- a/tomo.c
+++ b/tomo.c
@@ -316,11 +316,13 @@ int compile_executable(const char *filename, const char *object_files)
"#include <tomo/tomo.h>\n"
"#include \"", filename, ".h\"\n"
"\n"
+ "public bool USE_COLOR = true;\n"
+ "\n"
"int main(int argc, char *argv[]) {\n"
"GC_INIT();\n"
+ "USE_COLOR = getenv(\"COLOR\") ? strcmp(getenv(\"COLOR\"), \"1\") == 0 : isatty(STDOUT_FILENO);\n"
"srand(arc4random_uniform(UINT32_MAX));\n"
- "srand48(arc4random_uniform(UINT32_MAX));\n"
- "detect_color();\n",
+ "srand48(arc4random_uniform(UINT32_MAX));\n",
module_name, "$main$run(argc, argv);\n",
"return 0;\n"
"}\n"