Skip to content

Commit

Permalink
default to no color when terminal is dumb
Browse files Browse the repository at this point in the history
Signed-off-by: Wagner Riffel <[email protected]>
  • Loading branch information
wgrr committed Aug 19, 2019
1 parent 965f71d commit c2f85b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,14 @@ void print_version(void) {
}

void init_options(void) {
char *term = getenv("TERM");

memset(&opts, 0, sizeof(opts));
opts.casing = CASE_DEFAULT;
opts.color = TRUE;
if(strcmp(term, "dumb") == 0) {
opts.color = FALSE;
}
opts.color_win_ansi = FALSE;
opts.max_matches_per_file = 0;
opts.max_search_depth = DEFAULT_MAX_SEARCH_DEPTH;
Expand Down

0 comments on commit c2f85b8

Please sign in to comment.