Commit 94ec6fe1 authored by Damien Leroux's avatar Damien Leroux
Browse files

Added TTY check on start, so it doesn't output garbage when it shouldn't.

parent 94552bf0
......@@ -8,6 +8,9 @@
#include <sstream>
#include <thread>
#include <mutex>
extern "C" {
#include <unistd.h>
}
#define _WHITE "\x1b[37;1m"
#define _RED "\x1b[31;1m"
......@@ -29,7 +32,7 @@ struct msg_handler_t {
const char* info() { return color ? _CYAN : ""; }
const char* normal() { return color ? _NORMAL : ""; }
state_t() : color(true), workarounds(), count(0) {}
state_t() : color(!!isatty(fileno(stdout))), workarounds(), count(0) {}
void check(bool fatal);
void reset();
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment