Merge branch 'mn/sideband-no-ansi'

Tools that read diagnostic output in our standard error stream do
not want to see terminal control sequence (e.g. erase-to-eol).
Detect them by checking if the standard error stream is connected to
a tty.

* mn/sideband-no-ansi:
  sideband.c: do not use ANSI control sequence on non-terminal
This commit is contained in:
Junio C Hamano 2014-06-09 11:27:55 -07:00
commit 251cb96eab

View file

@ -30,7 +30,7 @@ int recv_sideband(const char *me, int in_stream, int out)
memcpy(buf, PREFIX, pf);
term = getenv("TERM");
if (term && strcmp(term, "dumb"))
if (isatty(2) && term && strcmp(term, "dumb"))
suffix = ANSI_SUFFIX;
else
suffix = DUMB_SUFFIX;