From adb0ea98d1fbdb2f9d863db1072deba199c0ae0e Mon Sep 17 00:00:00 2001 From: "Peter A. Bigot" Date: Mon, 11 Mar 2024 18:08:49 -0700 Subject: bitbake: lib/bb: support NO_COLOR Red text on a black background can make it difficult for people with visual impairments to read the text of error messages. Respect the presence of a non-empty NO_COLOR environment variable as an indication the user doesn't want colorization to be automatically enabled. See: https://no-color.org/ (Bitbake rev: d9986c54cd3d67ed1f7cb636b17696c8d0d4db85) Signed-off-by: Peter A. Bigot Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/knotty.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bitbake/lib/bb/ui/knotty.py') diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 5a97d040b0..f86999bb09 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py @@ -179,7 +179,7 @@ class TerminalFilter(object): new[3] = new[3] & ~termios.ECHO termios.tcsetattr(fd, termios.TCSADRAIN, new) curses.setupterm() - if curses.tigetnum("colors") > 2: + if curses.tigetnum("colors") > 2 and os.environ.get('NO_COLOR', '') == '': for h in handlers: try: h.formatter.enable_color() -- cgit v1.2.3-54-g00ecf