From a64f213d3fa13fa01e582b6734fe7883ed975dc9 Mon Sep 17 00:00:00 2001 From: Lars Schneider Date: Wed, 29 Nov 2017 15:37:51 +0100 Subject: 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 Signed-off-by: Junio C Hamano --- color.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'color.c') 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; -- cgit v1.2.3