From 2c549cc439dbea4f803566f22d188a6a76a74de2 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Fri, 25 Sep 2009 13:51:01 +0000 Subject: [PATCH] Add a new escape sequence to switch between cons25 and xterm. Just run this to switch to xterm: printf '\e[=T' If you get bored and want to switch back to cons25, run this: printf '\e[=1T' I can now send an email to the lists, asking whether people are interested in trying the xterm emulator. --- sys/teken/sequences | 1 + sys/teken/teken_subr_compat.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/sys/teken/sequences b/sys/teken/sequences index 8f7bfb443881..957665a02f53 100644 --- a/sys/teken/sequences +++ b/sys/teken/sequences @@ -104,6 +104,7 @@ C25ADBG Cons25 set adapter background ^[ [ = G r 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 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 c642af71770b..088f378af588 100644 --- a/sys/teken/teken_subr_compat.h +++ b/sys/teken/teken_subr_compat.h @@ -87,6 +87,20 @@ teken_subr_cons25_set_bell_pitch_duration(teken_t *t, unsigned int pitch, (duration & 0xffff)); } +static void +teken_subr_cons25_set_terminal_mode(teken_t *t, unsigned int mode) +{ + + switch (mode) { + case 0: /* Switch terminal to xterm. */ + t->t_stateflags &= ~TS_CONS25; + break; + case 1: /* Switch terminal to cons25. */ + t->t_stateflags |= TS_CONS25; + break; + } +} + #if 0 static void teken_subr_vt52_decid(teken_t *t)