mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
bitbake: knotty/msg: Avoid usage of curses initscr/endwin to avoid terminal corruption
Using curses initscr/endwin causes screen corruption if for example you suspend bitbake and resume it. This changes the code to use a less invasive approach to determining colour availability on the terminal. (Bitbake rev: 4548a8f037eaf8d47a77052acc3e9ec264ac41e0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
+1
-11
@@ -106,17 +106,7 @@ class BBLogFormatter(logging.Formatter):
|
||||
return record
|
||||
|
||||
def enable_color(self):
|
||||
import curses
|
||||
try:
|
||||
win = None
|
||||
win = curses.initscr()
|
||||
if curses.has_colors():
|
||||
self.color_enabled = True
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
if win is not None:
|
||||
curses.endwin()
|
||||
self.color_enabled = True
|
||||
|
||||
class BBLogFilter(object):
|
||||
def __init__(self, handler, level, debug_domains):
|
||||
|
||||
Reference in New Issue
Block a user