diff --git a/HISTORY.rst b/HISTORY.rst index 71f11b55..c67378b0 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -9,8 +9,9 @@ PlatformIO 4.0 4.0.3 (2019-??-??) ~~~~~~~~~~~~~~~~~~ -* Update SCons tool to 3.1.1 +* Support `PLATFORMIO_DISABLE_COLOR `__ system environment variable which disables color ANSI-codes in a terminal output (`issue #2956 `_) * Generate ``.ccls`` LSP file for `Vim `__ cross references, hierarchies, completion and semantic highlighting (`issue #2952 `_) +* Updated SCons tool to 3.1.1 * Remove ProjectConfig cache when "platformio.ini" was modified outside * Fixed an issue with PIO Unified Debugger on Windows OS when debug server is piped * Fixed an issue when `--upload-port `__ CLI flag does not override declared `upload_port `__ option in `"platformio.ini" (Project Configuration File) `__ diff --git a/docs b/docs index 6fd93411..771f77b1 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 6fd93411b2ddeb95c27bdcadb78dbb905c5219f8 +Subproject commit 771f77b1552e3b1a6f800ea91c192d30ae002ceb diff --git a/platformio/__main__.py b/platformio/__main__.py index d4664935..d88f69a8 100644 --- a/platformio/__main__.py +++ b/platformio/__main__.py @@ -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]