summaryrefslogtreecommitdiffstats
path: root/src/line_printer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/line_printer.cc')
-rw-r--r--src/line_printer.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/line_printer.cc b/src/line_printer.cc
index a3a551e..6effca6 100644
--- a/src/line_printer.cc
+++ b/src/line_printer.cc
@@ -42,6 +42,10 @@ LinePrinter::LinePrinter() : have_blank_line_(true), console_locked_(false) {
smart_terminal_ = GetConsoleScreenBufferInfo(console_, &csbi);
#endif
supports_color_ = smart_terminal_;
+ if (!supports_color_) {
+ const char* clicolor_force = getenv("CLICOLOR_FORCE");
+ supports_color_ = clicolor_force && string(clicolor_force) != "0";
+ }
}
void LinePrinter::Print(string to_print, LineType type) {