mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Windows: enable ANSI escape support in console.
This commit is contained in:
parent
b63748f557
commit
6c588f189d
2 changed files with 57 additions and 0 deletions
|
|
@ -1,7 +1,15 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
if os.name == 'nt': # pragma: no cover (windows)
|
||||
from pre_commit.color_windows import enable_virtual_terminal_processing
|
||||
try:
|
||||
enable_virtual_terminal_processing()
|
||||
except WindowsError:
|
||||
pass
|
||||
|
||||
RED = '\033[41m'
|
||||
GREEN = '\033[42m'
|
||||
YELLOW = '\033[43;30m'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue