summaryrefslogtreecommitdiffstats
path: root/sys/dev/syscons
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-01-05 22:09:46 +0000
committered <ed@FreeBSD.org>2009-01-05 22:09:46 +0000
commit5d4a97704b7d4a211d4249b88b7ac05d4faded1f (patch)
tree4aeaa7ab97a422c07c361474120deed02fe903e6 /sys/dev/syscons
parent657301ea439bb9bbe7992f4a870add5308023b24 (diff)
downloadFreeBSD-src-5d4a97704b7d4a211d4249b88b7ac05d4faded1f.zip
FreeBSD-src-5d4a97704b7d4a211d4249b88b7ac05d4faded1f.tar.gz
Import yet some more small fixes to libteken sources:
- Implement NP (ASCII 12, Form Feed). When used with cons25, it should clear the screen and place the cursor at the top of the screen. When used with xterm, it should just simulate a newline. - When we want to use xterm emulation, make teken_demo set TERM to xterm. Spotted by: Paul B. Mahol <onemda@gmail.com>
Diffstat (limited to 'sys/dev/syscons')
-rw-r--r--sys/dev/syscons/teken/teken.c3
-rw-r--r--sys/dev/syscons/teken/teken_demo.c4
-rw-r--r--sys/dev/syscons/teken/teken_subr.h18
3 files changed, 25 insertions, 0 deletions
diff --git a/sys/dev/syscons/teken/teken.c b/sys/dev/syscons/teken/teken.c
index b3c8bd4..62ded27 100644
--- a/sys/dev/syscons/teken/teken.c
+++ b/sys/dev/syscons/teken/teken.c
@@ -226,6 +226,9 @@ teken_input_char(teken_t *t, teken_char_t c)
case '\x0B':
teken_subr_newline(t);
break;
+ case '\x0C':
+ teken_subr_newpage(t);
+ break;
case '\r':
teken_subr_carriage_return(t);
break;
diff --git a/sys/dev/syscons/teken/teken_demo.c b/sys/dev/syscons/teken/teken_demo.c
index acea4f7..2d0a4bf 100644
--- a/sys/dev/syscons/teken/teken_demo.c
+++ b/sys/dev/syscons/teken/teken_demo.c
@@ -279,7 +279,11 @@ main(int argc __unused, char *argv[] __unused)
perror("forkpty");
exit(1);
case 0:
+#ifdef TEKEN_CONS25
setenv("TERM", "cons25", 1);
+#else /* !TEKEN_CONS25 */
+ setenv("TERM", "xterm", 1);
+#endif /* TEKEN_CONS25 */
#ifdef TEKEN_UTF8
setenv("LC_CTYPE", "UTF-8", 0);
#endif /* TEKEN_UTF8 */
diff --git a/sys/dev/syscons/teken/teken_subr.h b/sys/dev/syscons/teken/teken_subr.h
index 3288586..f26dc89 100644
--- a/sys/dev/syscons/teken/teken_subr.h
+++ b/sys/dev/syscons/teken/teken_subr.h
@@ -662,6 +662,24 @@ teken_subr_newline(teken_t *t)
}
static void
+teken_subr_newpage(teken_t *t)
+{
+#ifdef TEKEN_CONS25
+ teken_rect_t tr;
+
+ tr.tr_begin.tp_row = tr.tr_begin.tp_col = 0;
+ tr.tr_end = t->t_winsize;
+ teken_funcs_fill(t, &tr, BLANK, &t->t_curattr);
+
+ t->t_cursor.tp_row = t->t_cursor.tp_col = 0;
+ teken_funcs_cursor(t);
+#else /* !TEKEN_CONS25 */
+
+ teken_subr_newline(t);
+#endif /* TEKEN_CONS25 */
+}
+
+static void
teken_subr_next_line(teken_t *t)
{
OpenPOWER on IntegriCloud