mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
5a1f5c3060
commit
a64f213d3f
3
color.c
3
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;
|
||||
|
||||
Reference in New Issue
Block a user