From owner-svn-src-head@FreeBSD.ORG Fri Nov 5 00:56:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79C92106564A; Fri, 5 Nov 2010 00:56:21 +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 4DB228FC12; Fri, 5 Nov 2010 00:56:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA50uLSY078429; Fri, 5 Nov 2010 00:56:21 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA50uLk5078426; Fri, 5 Nov 2010 00:56:21 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201011050056.oA50uLk5078426@svn.freebsd.org> From: Ed Schouten Date: Fri, 5 Nov 2010 00:56:21 +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: r214817 - head/sys/teken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Nov 2010 00:56:21 -0000 Author: ed Date: Fri Nov 5 00:56:21 2010 New Revision: 214817 URL: http://svn.freebsd.org/changeset/base/214817 Log: Partially implement the mysterious cons25 \e[x escape sequence. It seems the terminfo library on some systems (OS X, Linux) may emit the sequence \e[x to reset to default attributes. Apart from using the zero-command, this escape sequence allows many more operations, such as setting ANSI colors. I don't see this used anywhere, so this should be sufficient for now. This deficiency was spotted by the Debian GNU/kFreeBSD. They have their own patch, which is slightly flawed in my opinion. I don't know why they never reported this issue to us. MFC after: 1 week Modified: head/sys/teken/sequences head/sys/teken/teken_subr_compat.h Modified: head/sys/teken/sequences ============================================================================== --- head/sys/teken/sequences Fri Nov 5 00:31:09 2010 (r214816) +++ head/sys/teken/sequences Fri Nov 5 00:56:21 2010 (r214817) @@ -106,6 +106,7 @@ C25ADFG Cons25 set adapter foreground ^ C25BLPD Cons25 set bell pitch duration ^[ [ = B r r C25CURS Cons25 set cursor type ^[ [ = S r C25MODE Cons25 set terminal mode ^[ [ = T r +C25SGR Cons25 set graphic rendition ^[ [ x r r C25VTSW Cons25 switch virtual terminal ^[ [ z r # VT52 compatibility Modified: head/sys/teken/teken_subr_compat.h ============================================================================== --- head/sys/teken/teken_subr_compat.h Fri Nov 5 00:31:09 2010 (r214816) +++ head/sys/teken/teken_subr_compat.h Fri Nov 5 00:56:21 2010 (r214817) @@ -88,6 +88,20 @@ teken_subr_cons25_set_bell_pitch_duratio } static void +teken_subr_cons25_set_graphic_rendition(teken_t *t, unsigned int cmd, + unsigned int param __unused) +{ + + switch (cmd) { + case 0: /* Reset. */ + t->t_curattr = t->t_defattr; + break; + default: + teken_printf("unsupported attribute %u\n", cmd); + } +} + +static void teken_subr_cons25_set_terminal_mode(teken_t *t, unsigned int mode) {