From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 10:26:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 761A91065676; Thu, 8 Oct 2009 10:26:50 +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 65D848FC13; Thu, 8 Oct 2009 10:26:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n98AQoZO019145; Thu, 8 Oct 2009 10:26:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n98AQoEM019144; Thu, 8 Oct 2009 10:26:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200910081026.n98AQoEM019144@svn.freebsd.org> From: Ed Schouten Date: Thu, 8 Oct 2009 10:26:50 +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: r197853 - head/sys/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2009 10:26:50 -0000 Author: ed Date: Thu Oct 8 10:26:49 2009 New Revision: 197853 URL: http://svn.freebsd.org/changeset/base/197853 Log: Discard Device Control Strings and Operating System Commands. These strings often contain things like: - Window titles. - Extended key map functionality. - Color palette switching. We could look at these features in the future (if people consider them to be important enough), but we'd better discard them now. This fixes some artifacts people reported when using TERM=xterm. Reported by: des@, Paul B. Mahol Modified: head/sys/teken/sequences head/sys/teken/teken.c head/sys/teken/teken_subr.h Modified: head/sys/teken/sequences ============================================================================== --- head/sys/teken/sequences Thu Oct 8 09:03:04 2009 (r197852) +++ head/sys/teken/sequences Thu Oct 8 10:26:49 2009 (r197853) @@ -88,6 +88,7 @@ ICH Insert character ^[ [ @ n IL Insert line ^[ [ L n IND Index ^[ D NEL Next line ^[ E +OSC Operating System Command ^[ ] RI Reverse index ^[ M RIS Reset to Initial State ^[ c RM Reset Mode ^[ [ l r Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Thu Oct 8 09:03:04 2009 (r197852) +++ head/sys/teken/teken.c Thu Oct 8 10:26:49 2009 (r197853) @@ -56,6 +56,7 @@ static FILE *df; #define TS_WRAPPED 0x10 /* Next character should be printed on col 0. */ #define TS_8BIT 0x20 /* UTF-8 disabled. */ #define TS_CONS25 0x40 /* cons25 emulation. */ +#define TS_INSTRING 0x80 /* Inside string. */ /* Character that blanks a cell. */ #define BLANK ' ' @@ -176,6 +177,24 @@ static void teken_input_char(teken_t *t, teken_char_t c) { + /* + * There is no support for DCS and OSC. Just discard strings + * until we receive characters that may indicate string + * termination. + */ + if (t->t_stateflags & TS_INSTRING) { + switch (c) { + case '\x1B': + t->t_stateflags &= ~TS_INSTRING; + break; + case '\a': + t->t_stateflags &= ~TS_INSTRING; + return; + default: + return; + } + } + switch (c) { case '\0': break; Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Thu Oct 8 09:03:04 2009 (r197852) +++ head/sys/teken/teken_subr.h Thu Oct 8 10:26:49 2009 (r197853) @@ -425,10 +425,11 @@ teken_subr_delete_line(teken_t *t, unsig } static void -teken_subr_device_control_string(teken_t *t __unused) +teken_subr_device_control_string(teken_t *t) { - teken_printf("device control string???\n"); + teken_printf("Unsupported device control string\n"); + t->t_stateflags |= TS_INSTRING; } static void @@ -744,6 +745,14 @@ teken_subr_next_line(teken_t *t) } static void +teken_subr_operating_system_command(teken_t *t) +{ + + teken_printf("Unsupported operating system command\n"); + t->t_stateflags |= TS_INSTRING; +} + +static void teken_subr_pan_down(teken_t *t, unsigned int nrows) { @@ -1258,7 +1267,10 @@ static void teken_subr_string_terminator(teken_t *t __unused) { - teken_printf("string terminator???\n"); + /* + * Strings are already terminated in teken_input_char() when ^[ + * is inserted. + */ } static void