From 772112df898555977d545a617908a57a236378ad Mon Sep 17 00:00:00 2001
From: mfranz <mfranz>
Date: Wed, 1 Oct 2008 14:04:47 +0000
Subject: [PATCH] use color codes only when printing to the terminal

---
 Nasal/debug.nas | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Nasal/debug.nas b/Nasal/debug.nas
index 3a70c4867..51320253c 100644
--- a/Nasal/debug.nas
+++ b/Nasal/debug.nas
@@ -49,7 +49,7 @@
 var _c = func nil;
 
 var color = func(enabled) {
-	if (enabled)
+	if (enabled and getprop("/sim/startup/stderr-to-terminal"))
 		_c = func(color, s) { "\x1b[" ~ color ~ "m" ~ s ~ "\x1b[m" }
 	else
 		_c = func(dummy, s) { s }