summaryrefslogtreecommitdiffstats
path: root/sys/dev/syscons
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-01-17 22:53:53 +0000
committered <ed@FreeBSD.org>2009-01-17 22:53:53 +0000
commit7bd93f5fdba0b7c3e3ccdf0397b393a6c18ffbdd (patch)
tree8704388076cc7284b489561f3bb384afca0b33f0 /sys/dev/syscons
parent7b43672a067a2db31fc87a15c48f06ac5268cbb5 (diff)
downloadFreeBSD-src-7bd93f5fdba0b7c3e3ccdf0397b393a6c18ffbdd.zip
FreeBSD-src-7bd93f5fdba0b7c3e3ccdf0397b393a6c18ffbdd.tar.gz
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)
Diffstat (limited to 'sys/dev/syscons')
-rw-r--r--sys/dev/syscons/teken/sequences2
-rw-r--r--sys/dev/syscons/teken/teken_subr_compat.h23
2 files changed, 25 insertions, 0 deletions
diff --git a/sys/dev/syscons/teken/sequences b/sys/dev/syscons/teken/sequences
index eb5a9fe..99aa226 100644
--- a/sys/dev/syscons/teken/sequences
+++ b/sys/dev/syscons/teken/sequences
@@ -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
diff --git a/sys/dev/syscons/teken/teken_subr_compat.h b/sys/dev/syscons/teken/teken_subr_compat.h
index 5378bb0..dea30d3 100644
--- a/sys/dev/syscons/teken/teken_subr_compat.h
+++ b/sys/dev/syscons/teken/teken_subr_compat.h
@@ -34,6 +34,29 @@ teken_subr_cons25_set_cursor_type(teken_t *t, unsigned int type)
}
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)
{
OpenPOWER on IntegriCloud