From d57a68063234f56bcf7c315e9a5c16bd069e626f Mon Sep 17 00:00:00 2001 From: Ulf Jordan Date: Wed, 3 Sep 2008 19:59:44 +0000 Subject: Add support for curses color output over serial. Note that the sequence \e[m for turning off bold resets all attributes, including color. Signed-off-by: Ulf Jordan Acked-by: Jordan Crouse git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3561 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- payloads/libpayload/curses/tinycurses.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'payloads/libpayload/curses') diff --git a/payloads/libpayload/curses/tinycurses.c b/payloads/libpayload/curses/tinycurses.c index 16e06ec473..960e74fc9e 100644 --- a/payloads/libpayload/curses/tinycurses.c +++ b/payloads/libpayload/curses/tinycurses.c @@ -669,10 +669,12 @@ int wnoutrefresh(WINDOW *win) // FIXME. int serial_is_bold = 0; int serial_is_altcharset = 0; + int serial_cur_pair = 0; int x, y; chtype ch; int need_altcharset; + short fg, bg; serial_end_bold(); serial_end_altcharset(); @@ -703,6 +705,7 @@ int wnoutrefresh(WINDOW *win) if (serial_is_bold) { serial_end_bold(); serial_is_bold = 0; + serial_cur_pair = 0; } } @@ -723,6 +726,13 @@ int wnoutrefresh(WINDOW *win) serial_is_altcharset = 0; } + if (serial_cur_pair != PAIR_NUMBER(attr)) { + pair_content(PAIR_NUMBER(attr), + &fg, &bg); + serial_set_color(fg, bg); + serial_cur_pair = PAIR_NUMBER(attr); + } + serial_putchar(ch); } -- cgit v1.2.3