The new quasi-standard for disabling ANSI color is to check for the NO_COLOR environment variable and disable color when the variable has a nonempty value. See https://no-color.org/: "Command-line software which adds ANSI color to its output by default should check for a NO_COLOR environment variable that, when present and not an empty string (regardless of its value), prevents the addition of ANSI color." Support for this was recently added to Portage itself, see bug 898224. Pkgcore supports it since 2021.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=1b82c21ec8897da285728f9e99e135fbd7406462 commit 1b82c21ec8897da285728f9e99e135fbd7406462 Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2023-03-21 17:05:59 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-03-22 03:36:35 +0000 Support the NO_COLOR environment variable Bug: https://bugs.gentoo.org/902551 Signed-off-by: Ulrich Müller <ulm@gentoo.org> Closes: https://github.com/gentoo/gentoolkit/pull/26 Signed-off-by: Sam James <sam@gentoo.org> bin/revdep-rebuild.sh | 18 ++++++++++-------- man/revdep-rebuild.1 | 2 +- pym/gentoolkit/base.py | 8 ++++++-- pym/gentoolkit/eclean/cli.py | 8 +++++--- pym/gentoolkit/ekeyword/ekeyword.py | 7 +++++-- pym/gentoolkit/equery/__init__.py | 4 ++-- 6 files changed, 29 insertions(+), 18 deletions(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c162ce62447fec711a28ecf1434879256c8aea6a commit c162ce62447fec711a28ecf1434879256c8aea6a Author: Sam James <sam@gentoo.org> AuthorDate: 2023-10-03 15:43:51 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-10-03 15:44:35 +0000 app-portage/gentoolkit: add 0.6.2 Bug: https://bugs.gentoo.org/900224 Closes: https://bugs.gentoo.org/369581 Closes: https://bugs.gentoo.org/382009 Closes: https://bugs.gentoo.org/576224 Closes: https://bugs.gentoo.org/709816 Closes: https://bugs.gentoo.org/861116 Closes: https://bugs.gentoo.org/877519 Closes: https://bugs.gentoo.org/902551 Signed-off-by: Sam James <sam@gentoo.org> app-portage/gentoolkit/Manifest | 1 + app-portage/gentoolkit/gentoolkit-0.6.2.ebuild | 71 ++++++++++++++++++++++++++ 2 files changed, 72 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=376afc18b75908ceb1d3c783b3c717d6b842c491 commit 376afc18b75908ceb1d3c783b3c717d6b842c491 Author: Sam James <sam@gentoo.org> AuthorDate: 2024-11-11 09:37:14 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-11-11 10:36:30 +0000 NOCOLOR -> NO_COLOR See https://no-color.org/. We already switched Portage and gentoolkit. Bug: https://bugs.gentoo.org/898224 Bug: https://bugs.gentoo.org/902551 Signed-off-by: Sam James <sam@gentoo.org> data/sandbox.bashrc | 4 ++-- etc/sandbox.conf | 4 ++-- libsbutil/sb_efuncs.c | 2 +- libsbutil/sbutil.h | 2 +- src/environ.c | 6 +++--- tests/test-skel-0.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-)