Skip to content

Commit 73505ef

Browse files
committed
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
2 parents e293c56 + 38de156 commit 73505ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sideband.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ int recv_sideband(const char *me, int in_stream, int out)
3030

3131
memcpy(buf, PREFIX, pf);
3232
term = getenv("TERM");
33-
if (term && strcmp(term, "dumb"))
33+
if (isatty(2) && term && strcmp(term, "dumb"))
3434
suffix = ANSI_SUFFIX;
3535
else
3636
suffix = DUMB_SUFFIX;

0 commit comments

Comments
 (0)