forked from platformio/platformio-core
Disable TTY coloring with "PLATFORMIO_DISABLE_COLOR" system environment // Resolve #2956
This commit is contained in:
1 parent
223a85baca
commit
0440b7a2f7
3 files changed
+10
-7
No files matched your search
@@ -55,13 +55,15 @@ def configure():
|
||||
except (AttributeError, ImportError):
|
||||
pass
|
||||
|
||||
# handle PLATFORMIO_FORCE_COLOR
|
||||
if str(os.getenv("PLATFORMIO_FORCE_COLOR", "")).lower() == "true":
|
||||
try:
|
||||
try:
|
||||
if str(os.getenv("PLATFORMIO_DISABLE_COLOR", "")).lower() == "true":
|
||||
# pylint: disable=protected-access
|
||||
click._compat.isatty = lambda stream: False
|
||||
elif str(os.getenv("PLATFORMIO_FORCE_COLOR", "")).lower() == "true":
|
||||
# pylint: disable=protected-access
|
||||
click._compat.isatty = lambda stream: True
|
||||
except: # pylint: disable=bare-except
|
||||
pass
|
||||
except: # pylint: disable=bare-except
|
||||
pass
|
||||
|
||||
# Handle IOError issue with VSCode's Terminal (Windows)
|
||||
click_echo_origin = [click.echo, click.secho]
|
||||
|
||||
Reference in new issue
Block a user