summaryrefslogtreecommitdiffstats
path: root/sys/teken
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2010-11-05 00:56:21 +0000
committered <ed@FreeBSD.org>2010-11-05 00:56:21 +0000
commita834f8918cf280d072e604e4df49953dc3d19fce (patch)
tree77b23035d68c9f13e2721acbd3b9ff0634c42994 /sys/teken
parentbfe6aa84f90b7b86c491748493b5b9859a78da97 (diff)
downloadFreeBSD-src-a834f8918cf280d072e604e4df49953dc3d19fce.zip
FreeBSD-src-a834f8918cf280d072e604e4df49953dc3d19fce.tar.gz
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
Diffstat (limited to 'sys/teken')
-rw-r--r--sys/teken/sequences1
-rw-r--r--sys/teken/teken_subr_compat.h14
2 files changed, 15 insertions, 0 deletions
diff --git a/sys/teken/sequences b/sys/teken/sequences
index cf720b0..a8ee528 100644
--- a/sys/teken/sequences
+++ b/sys/teken/sequences
@@ -106,6 +106,7 @@ C25ADFG Cons25 set adapter foreground ^[ [ = F r
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
diff --git a/sys/teken/teken_subr_compat.h b/sys/teken/teken_subr_compat.h
index e937298..a79cdfb 100644
--- a/sys/teken/teken_subr_compat.h
+++ b/sys/teken/teken_subr_compat.h
@@ -88,6 +88,20 @@ teken_subr_cons25_set_bell_pitch_duration(teken_t *t, unsigned int pitch,
}
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)
{
OpenPOWER on IntegriCloud