qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/3] ui/curses: Fix monitor color with -curses when


From: OGAWA Hirofumi
Subject: [Qemu-devel] [PATCH 1/3] ui/curses: Fix monitor color with -curses when 256 colors
Date: Wed, 14 Oct 2015 20:36:38 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

If TERM=xterm-256color, COLOR_PAIRS==256 and monitor passes chtype
like 0x74xx. Then, the code uses uninitialized color pair. As result,
monitor uses black for both of fg and bg color, i.e. terminal is
filled by black.

To fix, this initialize above than 64 with default color (fg=white,bg=black).

FIXME: on 256 color, curses may be possible better vga color emulation.

Signed-off-by: OGAWA Hirofumi <address@hidden>
---

 ui/curses.c |    3 +++
 1 file changed, 3 insertions(+)

diff -puN ui/curses.c~support-curses-256color ui/curses.c
--- qemu/ui/curses.c~support-curses-256color    2015-10-14 20:12:06.311051365 
+0900
+++ qemu-hirofumi/ui/curses.c   2015-10-14 20:27:39.417674271 +0900
@@ -343,6 +343,9 @@ static void curses_setup(void)
 
     for (i = 0; i < 64; i ++)
         init_pair(i, colour_default[i & 7], colour_default[i >> 3]);
+    /* Set default color for more than 64. (monitor uses 0x74xx for example) */
+    for (i = 64; i < COLOR_PAIRS; i ++)
+        init_pair(i, COLOR_WHITE, COLOR_BLACK);
 }
 
 static void curses_keyboard_setup(void)
_



reply via email to

[Prev in Thread] Current Thread [Next in Thread]