Skip to content

Commit

Permalink
Suppress the usage of ANSI color when TERM=dumb
Browse files Browse the repository at this point in the history
  • Loading branch information
superatomic committed Sep 5, 2023
1 parent 1221945 commit d553712
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tldr_man/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ def subcommand_manpath(locales, page_sections):

@command(cls=HelpColorsCommand,
**HELP_COLORS,
context_settings={'color': False if getenv('TLDR_MAN_NO_COLOR') or getenv('NO_COLOR') else None},
context_settings={
'color': False if getenv('TERM') == 'dumb' or getenv('TLDR_MAN_NO_COLOR') or getenv('NO_COLOR') else None,
},
no_args_is_help=True)
@argument('page', nargs=-1, required=True, shell_complete=page_shell_complete)
@option('-p', '--platform',
Expand Down

0 comments on commit d553712

Please sign in to comment.