Make vidcontrol's color setting work again.

It turns out I forgot to implement two escape sequences that allows the
user to change the default foreground and background colors. I thought
they were implemented by syscons itself, but vidcontrol just generates
some escape sequences, which get interpreted by the terminal emulator.

Reported by:	mgp (forums)
This commit is contained in:
Ed Schouten 2009-01-17 22:53:53 +00:00
parent bfe3989e73
commit ec9037a258
2 changed files with 25 additions and 0 deletions

View file

@ -100,6 +100,8 @@ TBC Tab Clear ^[ [ g r
VPA Vertical Position Absolute ^[ [ d n
# Cons25 compatibility sequences
C25ADBG Cons25 set adapter background ^[ [ = G r
C25ADFG Cons25 set adapter foreground ^[ [ = F r
C25CURS Cons25 set cursor type ^[ [ = S r
C25VTSW Cons25 switch virtual terminal ^[ [ z r

View file

@ -33,6 +33,29 @@ teken_subr_cons25_set_cursor_type(teken_t *t, unsigned int type)
teken_funcs_param(t, TP_SHOWCURSOR, type != 1);
}
static void
teken_subr_cons25_set_adapter_background(teken_t *t, unsigned int c)
{
t->t_defattr.ta_bgcolor = c % 8;
t->t_curattr.ta_bgcolor = c % 8;
}
static void
teken_subr_cons25_set_adapter_foreground(teken_t *t, unsigned int c)
{
t->t_defattr.ta_fgcolor = c % 8;
t->t_curattr.ta_fgcolor = c % 8;
if (c >= 8) {
t->t_defattr.ta_format |= TF_BOLD;
t->t_curattr.ta_format |= TF_BOLD;
} else {
t->t_defattr.ta_format &= ~TF_BOLD;
t->t_curattr.ta_format &= ~TF_BOLD;
}
}
static void
teken_subr_cons25_switch_virtual_terminal(teken_t *t, unsigned int vt)
{