Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jan 2009 22:53:53 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r187373 - head/sys/dev/syscons/teken
Message-ID:  <200901172253.n0HMrrMI054516@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Sat Jan 17 22:53:53 2009
New Revision: 187373
URL: http://svn.freebsd.org/changeset/base/187373

Log:
  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)

Modified:
  head/sys/dev/syscons/teken/sequences
  head/sys/dev/syscons/teken/teken_subr_compat.h

Modified: head/sys/dev/syscons/teken/sequences
==============================================================================
--- head/sys/dev/syscons/teken/sequences	Sat Jan 17 21:31:47 2009	(r187372)
+++ head/sys/dev/syscons/teken/sequences	Sat Jan 17 22:53:53 2009	(r187373)
@@ -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
 

Modified: head/sys/dev/syscons/teken/teken_subr_compat.h
==============================================================================
--- head/sys/dev/syscons/teken/teken_subr_compat.h	Sat Jan 17 21:31:47 2009	(r187372)
+++ head/sys/dev/syscons/teken/teken_subr_compat.h	Sat Jan 17 22:53:53 2009	(r187373)
@@ -34,6 +34,29 @@ teken_subr_cons25_set_cursor_type(teken_
 }
 
 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)
 {
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901172253.n0HMrrMI054516>