diff options
author | 2014-06-09 11:27:55 -0700 | |
---|---|---|
committer | 2014-06-09 11:27:56 -0700 | |
commit | 251cb96eabb983ee1b699254399642b306cf19bf (patch) | |
tree | 03da1ab8edbd6dae26b49292616835b83452b1f6 | |
parent | Merge branch 'rs/mailinfo-header-cmp' (diff) | |
parent | sideband.c: do not use ANSI control sequence on non-terminal (diff) | |
download | tgif-251cb96eabb983ee1b699254399642b306cf19bf.tar.xz |
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
-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; |