warning_ignore_table = null;
warning_regions_table = null;
reporting_disabled = false;
+ error_stack = warning_stack = null;
}
public static void DisableReporting ()
sealed class ErrorMessage : AbstractMessage
{
static string prefix, postfix;
+
+ [System.Runtime.InteropServices.DllImport ("libc", EntryPoint="isatty")]
+ extern static int _isatty (int fd);
+
+ static bool isatty (int fd)
+ {
+ try {
+ return _isatty (fd) == 1;
+ } catch {
+ return false;
+ }
+ }
static ErrorMessage ()
{
xterm_colors = true;
break;
}
+ if (!xterm_colors)
+ return;
+
+ if (!(isatty (1) && isatty (2)))
+ return;
+
string config = Environment.GetEnvironmentVariable ("MCS_COLORS");
if (config == null){
config = "errors=red";
config = config.Substring (7);
- if (!xterm_colors)
- return;
-
int p = config.IndexOf (",");
if (p == -1)
prefix = GetForeground (config);