=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/input.c,v retrieving revision 1.126 retrieving revision 1.127 diff -c -r1.126 -r1.127 *** src/usr.bin/tmux/input.c 2017/06/09 09:21:24 1.126 --- src/usr.bin/tmux/input.c 2017/08/29 09:28:45 1.127 *************** *** 1,4 **** ! /* $OpenBSD: input.c,v 1.126 2017/06/09 09:21:24 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: input.c,v 1.127 2017/08/29 09:28:45 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 87,92 **** --- 87,93 ---- struct utf8_data utf8data; int ch; + int last; int flags; #define INPUT_DISCARD 0x1 *************** *** 221,226 **** --- 222,228 ---- INPUT_CSI_ICH, INPUT_CSI_IL, INPUT_CSI_RCP, + INPUT_CSI_REP, INPUT_CSI_RM, INPUT_CSI_RM_PRIVATE, INPUT_CSI_SCP, *************** *** 252,257 **** --- 254,260 ---- { 'S', "", INPUT_CSI_SU }, { 'X', "", INPUT_CSI_ECH }, { 'Z', "", INPUT_CSI_CBT }, + { 'b', "", INPUT_CSI_REP }, { 'c', "", INPUT_CSI_DA }, { 'c', ">", INPUT_CSI_DA_TWO }, { 'd', "", INPUT_CSI_VPA }, *************** *** 848,853 **** --- 851,858 ---- input_clear(ictx); + ictx->last = -1; + ictx->state = &input_state_ground; ictx->flags = 0; } *************** *** 1062,1067 **** --- 1067,1073 ---- utf8_set(&ictx->cell.cell.data, ictx->ch); screen_write_collect_add(&ictx->ctx, &ictx->cell.cell); + ictx->last = ictx->ch; ictx->cell.cell.attr &= ~GRID_ATTR_CHARSET; *************** *** 1168,1173 **** --- 1174,1180 ---- break; } + ictx->last = -1; return (0); } *************** *** 1245,1250 **** --- 1252,1258 ---- break; } + ictx->last = -1; return (0); } *************** *** 1255,1261 **** struct screen_write_ctx *sctx = &ictx->ctx; struct screen *s = sctx->s; struct input_table_entry *entry; ! int n, m; u_int cx; if (ictx->flags & INPUT_DISCARD) --- 1263,1269 ---- struct screen_write_ctx *sctx = &ictx->ctx; struct screen *s = sctx->s; struct input_table_entry *entry; ! int i, n, m; u_int cx; if (ictx->flags & INPUT_DISCARD) *************** *** 1421,1426 **** --- 1429,1443 ---- screen_write_insertline(sctx, input_get(ictx, 0, 1, 1), ictx->cell.cell.bg); break; + case INPUT_CSI_REP: + if (ictx->last == -1) + break; + ictx->ch = ictx->last; + + n = input_get(ictx, 0, 1, 1); + for (i = 0; i < n; i++) + input_print(ictx); + break; case INPUT_CSI_RCP: memcpy(&ictx->cell, &ictx->old_cell, sizeof ictx->cell); screen_write_cursormove(sctx, ictx->old_cx, ictx->old_cy); *************** *** 1473,1478 **** --- 1490,1496 ---- break; } + ictx->last = -1; return (0); } *************** *** 1877,1882 **** --- 1895,1901 ---- input_clear(ictx); input_start_timer(ictx); + ictx->last = -1; } /* DCS terminator (ST) received. */ *************** *** 1909,1914 **** --- 1928,1934 ---- input_clear(ictx); input_start_timer(ictx); + ictx->last = -1; } /* OSC terminator (ST) received. */ *************** *** 1976,1981 **** --- 1996,2002 ---- input_clear(ictx); input_start_timer(ictx); + ictx->last = -1; } /* APC terminator (ST) received. */ *************** *** 2000,2005 **** --- 2021,2027 ---- input_clear(ictx); input_start_timer(ictx); + ictx->last = -1; } /* Rename terminator (ST) received. */ *************** *** 2029,2034 **** --- 2051,2057 ---- fatalx("UTF-8 open invalid %#x", ictx->ch); log_debug("%s %hhu", __func__, ud->size); + ictx->last = -1; return (0); }