diff options
Diffstat (limited to 'sys/dev/cons/cons.c')
-rw-r--r-- | sys/dev/cons/cons.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/dev/cons/cons.c b/sys/dev/cons/cons.c index 61254a7..671d5f0 100644 --- a/sys/dev/cons/cons.c +++ b/sys/dev/cons/cons.c @@ -158,6 +158,8 @@ cons_handle_special(struct cons_screen *scr, char c) } switch (c) { + case ASCII_NUL: + return 0; case ASCII_BS: bp = scr->ob[scr->ch_row]; if (bp->head > bp->tail) { @@ -262,6 +264,14 @@ cons_fast_putch(struct cons_screen *scr, char c) { struct cons_char cc; struct cons_buf *bp; + int ansi; + + ansi = ansi_feed(&scr->ansi_s, c); + if (ansi > 0) { + c = ASCII_NUL; + } else if (ansi < 0) { + c = ASCII_NUL; + } /* Handle specials */ if (cons_handle_special(scr, c) == 0) { @@ -379,6 +389,23 @@ cons_init_bufs(struct cons_screen *scr) } /* + * Reset console color. + */ +void +cons_reset_color(struct cons_screen *scr) +{ + g_root_scr.fg = CONSOLE_FG; + g_root_scr.bg = CONSOLE_BG; +} + +void +cons_update_color(struct cons_screen *scr, uint32_t fg, uint32_t bg) +{ + scr->fg = fg; + scr->bg = bg; +} + +/* * Put a character on the screen. * * @scr: Screen. |