colors: `COLOR_RESULTS switched to False` for non-interactive command case (#5562)

### Motivation

Running commands with disabled `COLOR_RESULTS` around 40% faster. It
should be by default.


Closes #5561

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Andy Kipp 2024-07-01 17:42:46 +02:00 committed by GitHub
parent 69dce1b293
commit ae7fefee06
Failed to generate hash of commit
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,23 @@
**Added:**
* <news item>
**Changed:**
* ``COLOR_RESULTS`` switched to ``False`` for non-interactive command case to improve speed in default behavior (#5562).
**Deprecated:**
* <news item>
**Removed:**
* <news item>
**Fixed:**
* <news item>
**Security:**
* <news item>

View file

@ -426,6 +426,7 @@ def premain(argv=None):
"XONSH_INTERACTIVE": args.force_interactive
or (args.mode == XonshMode.interactive),
}
pre_env["COLOR_RESULTS"] = os.getenv("COLOR_RESULTS", pre_env["XONSH_INTERACTIVE"])
# Load -DVAR=VAL arguments.
if args.defines is not None: