mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Disable color if TERM=dumb is detected
This commit is contained in:
parent
376d283ba3
commit
120cae9d41
2 changed files with 18 additions and 4 deletions
|
|
@ -49,6 +49,10 @@ def use_color(setting):
|
|||
raise InvalidColorSetting(setting)
|
||||
|
||||
return (
|
||||
setting == 'always' or
|
||||
(setting == 'auto' and sys.stdout.isatty() and terminal_supports_color)
|
||||
setting == 'always' or (
|
||||
setting == 'auto' and
|
||||
sys.stdout.isatty() and
|
||||
terminal_supports_color and
|
||||
os.getenv('TERM') != 'dumb'
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue