From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 22:53:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9133E106566B; Sat, 17 Jan 2009 22:53:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6613A8FC1C; Sat, 17 Jan 2009 22:53:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HMrr01054518; Sat, 17 Jan 2009 22:53:53 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HMrrMI054516; Sat, 17 Jan 2009 22:53:53 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200901172253.n0HMrrMI054516@svn.freebsd.org> From: Ed Schouten Date: Sat, 17 Jan 2009 22:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187373 - head/sys/dev/syscons/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 22:53:54 -0000 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) {