From owner-svn-src-head@FreeBSD.ORG Mon Jan 5 22:09:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CCF11065716; Mon, 5 Jan 2009 22:09:47 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A7C28FC17; Mon, 5 Jan 2009 22:09:47 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n05M9lBG012760; Mon, 5 Jan 2009 22:09:47 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n05M9liJ012756; Mon, 5 Jan 2009 22:09:47 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200901052209.n05M9liJ012756@svn.freebsd.org> From: Ed Schouten Date: Mon, 5 Jan 2009 22:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186798 - head/sys/dev/syscons/teken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jan 2009 22:09:48 -0000 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 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) {