svn commit: r214817 - head/sys/teken
Ed Schouten
ed at FreeBSD.org
Fri Nov 5 00:56:21 UTC 2010
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)
{
More information about the svn-src-all
mailing list