diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-06-25 11:43:43 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-25 11:43:43 -0700 |
commit | 73505ef7a5f5da4f31a86a12c1ab47ffcebdb73a (patch) | |
tree | 9b66aef1222128b872d557d46e72351db24b099a | |
parent | Merge branch 'je/pager-do-not-recurse' into maint (diff) | |
parent | sideband.c: do not use ANSI control sequence on non-terminal (diff) | |
download | tgif-73505ef7a5f5da4f31a86a12c1ab47ffcebdb73a.tar.xz |
Merge branch 'mn/sideband-no-ansi' into maint
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
-rw-r--r-- | sideband.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sideband.c b/sideband.c index d1125f5c52..7f9dc229fb 100644 --- a/sideband.c +++ b/sideband.c @@ -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; |