From ad78e41b85a936e5d2aa3630db3f4815af257254 Mon Sep 17 00:00:00 2001 From: Sergey Nenakhov Date: Sat, 23 Apr 2011 14:19:16 -0700 Subject: [PATCH] [windows] disable smart terminal support --- src/build.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/build.cc b/src/build.cc index ba7f1be..98e0bfd 100644 --- a/src/build.cc +++ b/src/build.cc @@ -15,9 +15,11 @@ #include "build.h" #include +#ifndef WIN32 #include #include #include +#endif #include "build_log.h" #include "graph.h" @@ -47,8 +49,12 @@ struct BuildStatus { BuildStatus::BuildStatus() : last_update_(time(NULL)), finished_edges_(0), total_edges_(0), verbosity_(BuildConfig::NORMAL) { +#ifndef WIN32 const char* term = getenv("TERM"); smart_terminal_ = isatty(1) && term && string(term) != "dumb"; +#else + smart_terminal_ = false; +#endif } void BuildStatus::PlanHasTotalEdges(int total) { @@ -104,7 +110,7 @@ void BuildStatus::PrintStatus(Edge* edge) { string to_print = edge->GetDescription(); if (to_print.empty() || verbosity_ == BuildConfig::VERBOSE) to_print = edge->EvaluateCommand(); - +#ifndef WIN32 if (smart_terminal_) { // Limit output to width of the terminal if provided so we don't cause // line-wrapping. @@ -121,7 +127,9 @@ void BuildStatus::PrintStatus(Edge* edge) { printf("\r[%d/%d] %s\e[K", finished_edges_, total_edges_, to_print.c_str()); fflush(stdout); - } else { + } else +#endif + { printf("%s\n", to_print.c_str()); } } -- 2.34.1