Date: Mon, 5 Jan 2009 22:09:47 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r186798 - head/sys/dev/syscons/teken Message-ID: <200901052209.n05M9liJ012756@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Mon Jan 5 22:09:46 2009 New Revision: 186798 URL: http://svn.freebsd.org/changeset/base/186798 Log: 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> Modified: head/sys/dev/syscons/teken/teken.c head/sys/dev/syscons/teken/teken_demo.c head/sys/dev/syscons/teken/teken_subr.h Modified: head/sys/dev/syscons/teken/teken.c ============================================================================== --- head/sys/dev/syscons/teken/teken.c Mon Jan 5 21:51:49 2009 (r186797) +++ head/sys/dev/syscons/teken/teken.c Mon Jan 5 22:09:46 2009 (r186798) @@ -226,6 +226,9 @@ teken_input_char(teken_t *t, teken_char_ case '\x0B': teken_subr_newline(t); break; + case '\x0C': + teken_subr_newpage(t); + break; case '\r': teken_subr_carriage_return(t); break; Modified: head/sys/dev/syscons/teken/teken_demo.c ============================================================================== --- head/sys/dev/syscons/teken/teken_demo.c Mon Jan 5 21:51:49 2009 (r186797) +++ head/sys/dev/syscons/teken/teken_demo.c Mon Jan 5 22:09:46 2009 (r186798) @@ -279,7 +279,11 @@ main(int argc __unused, char *argv[] __u 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 */ Modified: head/sys/dev/syscons/teken/teken_subr.h ============================================================================== --- head/sys/dev/syscons/teken/teken_subr.h Mon Jan 5 21:51:49 2009 (r186797) +++ head/sys/dev/syscons/teken/teken_subr.h Mon Jan 5 22:09:46 2009 (r186798) @@ -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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901052209.n05M9liJ012756>