1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

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 <pab@pabigot.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Peter A. Bigot
2024-03-11 18:08:49 -07:00
committed by Richard Purdie
parent 2eeef2800b
commit adb0ea98d1
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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()