From bf85eaf05f2fbdd20015dc3de7045536881eb199 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Tue, 10 Oct 2017 21:36:06 +1300 Subject: [PATCH] do not overwrite the top 8 colors of the palette with black --- subiquity/palette.py | 2 +- subiquitycore/core.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/subiquity/palette.py b/subiquity/palette.py index 90e75be3..092044f5 100644 --- a/subiquity/palette.py +++ b/subiquity/palette.py @@ -47,7 +47,7 @@ URWID_16_NAMES = [ URWID16 = {} URWID256 = {} -PALETTE = bytearray(16*3) +PALETTE = bytearray(8*3) colors = { 0: ("bg", (0x00, 0x00, 0x00)), diff --git a/subiquitycore/core.py b/subiquitycore/core.py index 4064bc41..4735c448 100644 --- a/subiquitycore/core.py +++ b/subiquitycore/core.py @@ -44,7 +44,10 @@ UO_R, UO_G, UO_B = 0xe9, 0x54, 0x20 def setup_ubuntu_orange(pal, additional_opts): """Overwrite color 4 (usually "dark blue") to Ubuntu orange.""" if is_linux_tty(): - fcntl.ioctl(sys.stdout.fileno(), PIO_CMAP, pal) + curpal = bytearray(16*3) + fcntl.ioctl(sys.stdout.fileno(), GIO_CMAP, curpal) + curpal[:8] = pal + fcntl.ioctl(sys.stdout.fileno(), PIO_CMAP, curpal) elif os.environ['TERM'] == 'fbterm': print('\033[3;4;%i;%i;%i}' % (UO_R, UO_G, UO_B), flush=True) else: