summary refs log tree commit diff
path: root/color.c
diff options
context:
space:
mode:
authorLars Schneider <larsxschneider@gmail.com>2017-11-29 15:37:51 +0100
committerJunio C Hamano <gitster@pobox.com>2017-12-04 09:38:30 -0800
commita64f213d3fa13fa01e582b6734fe7883ed975dc9 (patch)
tree24b1b8f7e95c639ed5cf1c77f6bd6e7753e9a20a /color.c
parent5a1f5c3060427375de30d609d72ac032516be4c2 (diff)
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 'color.c')
-rw-r--r--color.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/color.c b/color.c
index 9a9261ac16..d48dd947c9 100644
--- a/color.c
+++ b/color.c
@@ -329,8 +329,7 @@ static int check_auto_color(void)
 	if (color_stdout_is_tty < 0)
 		color_stdout_is_tty = isatty(1);
 	if (color_stdout_is_tty || (pager_in_use() && pager_use_color)) {
-		char *term = getenv("TERM");
-		if (term && strcmp(term, "dumb"))
+		if (!is_terminal_dumb())
 			return 1;
 	}
 	return 0;