qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: qemu-devel@nongnu.org
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	[thread overview]
Message-ID: <87fv1d8ywp.fsf@mail.parknet.co.jp> (raw)
In-Reply-To: <87k2qp8yxv.fsf@mail.parknet.co.jp> (OGAWA Hirofumi's message of "Wed, 14 Oct 2015 20:35:56 +0900")


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 <hirofumi@mail.parknet.co.jp>
---

 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	other threads:[~2015-10-14 11:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 11:35 [Qemu-devel] [RFC 0/3] improve/fix -curses mode OGAWA Hirofumi
2015-10-14 11:36 ` OGAWA Hirofumi [this message]
2015-10-14 11:37   ` [Qemu-devel] [PATCH 2/3] ui/curses: Support line graphics chars on " OGAWA Hirofumi
2015-10-14 11:37     ` [Qemu-devel] [PATCH 3/3] ui/curses: Fix pageup/pagedown on -curses OGAWA Hirofumi
2015-10-14 14:04     ` [Qemu-devel] [PATCH 2/3] ui/curses: Support line graphics chars on -curses mode Eric Blake
2015-10-14 15:44     ` Gerd Hoffmann
2015-10-14 23:58       ` OGAWA Hirofumi
2015-10-15  0:06         ` OGAWA Hirofumi
2015-10-15  0:07           ` [Qemu-devel] [PATCH v2 1/3] " OGAWA Hirofumi
2015-10-15  7:48         ` [Qemu-devel] [PATCH 2/3] " Gerd Hoffmann
2015-10-15  8:24           ` OGAWA Hirofumi
2015-10-15  8:50             ` OGAWA Hirofumi
2015-10-15  9:13               ` Gerd Hoffmann
2015-10-15  9:54                 ` OGAWA Hirofumi
2015-10-15  9:54                   ` [Qemu-devel] [PATCH v3] " OGAWA Hirofumi
2015-10-19 10:14                   ` [Qemu-devel] [PATCH 2/3] " Gerd Hoffmann
2015-10-19 12:22                     ` OGAWA Hirofumi
2015-10-15  9:14             ` Gerd Hoffmann
2015-10-15  9:58               ` OGAWA Hirofumi
2015-10-15 10:01                 ` [Qemu-devel] [PATCH v4] " OGAWA Hirofumi
2015-10-14 16:46 ` [Qemu-devel] [RFC 0/3] improve/fix " Markus Armbruster
2015-10-14 23:59   ` OGAWA Hirofumi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fv1d8ywp.fsf@mail.parknet.co.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).