Revision: 2621
          http://tmux.svn.sourceforge.net/tmux/?rev=2621&view=rev
Author:   tcunha
Date:     2011-10-23 15:10:22 +0000 (Sun, 23 Oct 2011)
Log Message:
-----------
Sync OpenBSD patchset 969:

Support for \e[3J to clear the history. Also send the corresponding
terminfo code (E3) before locking.

Modified Paths:
--------------
    trunk/input.c
    trunk/screen-write.c
    trunk/server-fn.c
    trunk/tmux.h
    trunk/tty-term.c

Modified: trunk/input.c
===================================================================
--- trunk/input.c       2011-10-23 15:08:58 UTC (rev 2620)
+++ trunk/input.c       2011-10-23 15:10:22 UTC (rev 2621)
@@ -1126,6 +1126,17 @@
                case 2:
                        screen_write_clearscreen(sctx);
                        break;
+               case 3:
+                       switch (input_get(ictx, 1, 0, 0)) {
+                       case 0:
+                               /*
+                                * Linux console extension to clear history
+                                * (for example before locking the screen).
+                                */
+                               screen_write_clearhistory(sctx);
+                               break;
+                       }
+                       break;
                default:
                        log_debug("%s: unknown '%c'", __func__, ictx->ch);
                        break;

Modified: trunk/screen-write.c
===================================================================
--- trunk/screen-write.c        2011-10-23 15:08:58 UTC (rev 2620)
+++ trunk/screen-write.c        2011-10-23 15:10:22 UTC (rev 2621)
@@ -985,6 +985,17 @@
        tty_write(tty_cmd_clearscreen, &ttyctx);
 }
 
+/* Clear entire history. */
+void
+screen_write_clearhistory(struct screen_write_ctx *ctx)
+{
+       struct screen   *s = ctx->s;
+       struct grid     *gd = s->grid;
+
+       grid_move_lines(gd, 0, gd->hsize, gd->sy);
+       gd->hsize = 0;
+}
+
 /* Write cell data. */
 void
 screen_write_cell(struct screen_write_ctx *ctx,

Modified: trunk/server-fn.c
===================================================================
--- trunk/server-fn.c   2011-10-23 15:08:58 UTC (rev 2620)
+++ trunk/server-fn.c   2011-10-23 15:10:22 UTC (rev 2621)
@@ -237,6 +237,7 @@
        tty_stop_tty(&c->tty);
        tty_raw(&c->tty, tty_term_string(c->tty.term, TTYC_SMCUP));
        tty_raw(&c->tty, tty_term_string(c->tty.term, TTYC_CLEAR));
+       tty_raw(&c->tty, tty_term_string(c->tty.term, TTYC_E3));
 
        c->flags |= CLIENT_SUSPENDED;
        server_write_client(c, MSG_LOCK, &lockdata, sizeof lockdata);

Modified: trunk/tmux.h
===================================================================
--- trunk/tmux.h        2011-10-23 15:08:58 UTC (rev 2620)
+++ trunk/tmux.h        2011-10-23 15:10:22 UTC (rev 2621)
@@ -202,6 +202,7 @@
        TTYC_DIM,       /* enter_dim_mode, mh */
        TTYC_DL,        /* parm_delete_line, DL */
        TTYC_DL1,       /* delete_line, dl */
+       TTYC_E3,
        TTYC_EL,        /* clr_eol, ce */
        TTYC_EL1,       /* clr_bol, cb */
        TTYC_ENACS,     /* ena_acs, eA */
@@ -1862,6 +1863,7 @@
 void    screen_write_clearendofscreen(struct screen_write_ctx *);
 void    screen_write_clearstartofscreen(struct screen_write_ctx *);
 void    screen_write_clearscreen(struct screen_write_ctx *);
+void    screen_write_clearhistory(struct screen_write_ctx *);
 void    screen_write_cell(struct screen_write_ctx *,
             const struct grid_cell *, const struct utf8_data *);
 void    screen_write_setselection(struct screen_write_ctx *, u_char *, u_int);

Modified: trunk/tty-term.c
===================================================================
--- trunk/tty-term.c    2011-10-23 15:08:58 UTC (rev 2620)
+++ trunk/tty-term.c    2011-10-23 15:10:22 UTC (rev 2621)
@@ -64,6 +64,7 @@
        { TTYC_DIM, TTYCODE_STRING, "dim" },
        { TTYC_DL, TTYCODE_STRING, "dl" },
        { TTYC_DL1, TTYCODE_STRING, "dl1" },
+       { TTYC_E3, TTYCODE_STRING, "E3" },
        { TTYC_EL, TTYCODE_STRING, "el" },
        { TTYC_EL1, TTYCODE_STRING, "el1" },
        { TTYC_ENACS, TTYCODE_STRING, "enacs" },

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
tmux-cvs mailing list
tmux-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to