diff options
author | Lars Schneider <larsxschneider@gmail.com> | 2017-11-29 15:37:51 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-12-04 09:38:30 -0800 |
commit | a64f213d3fa13fa01e582b6734fe7883ed975dc9 (patch) | |
tree | 24b1b8f7e95c639ed5cf1c77f6bd6e7753e9a20a /sideband.c | |
parent | 5a1f5c3060427375de30d609d72ac032516be4c2 (diff) | |
download | git-a64f213d3fa13fa01e582b6734fe7883ed975dc9.tar.gz |
refactor "dumb" terminal determination
Move the code to detect "dumb" terminals into a single location. This
avoids duplicating the terminal detection code yet again in a subsequent
commit.
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sideband.c')
-rw-r--r-- | sideband.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sideband.c b/sideband.c index 1e4d684d6c..6d7f943e43 100644 --- a/sideband.c +++ b/sideband.c @@ -20,13 +20,12 @@ int recv_sideband(const char *me, int in_stream, int out) { - const char *term, *suffix; + const char *suffix; char buf[LARGE_PACKET_MAX + 1]; struct strbuf outbuf = STRBUF_INIT; int retval = 0; - term = getenv("TERM"); - if (isatty(2) && term && strcmp(term, "dumb")) + if (isatty(2) && !is_terminal_dumb()) suffix = ANSI_SUFFIX; else suffix = DUMB_SUFFIX; |