aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2017-02-08 18:01:17 +0000
committerThomas Adam <thomas@xteddy.org>2017-02-08 18:01:17 +0000
commit130b77edc737fcd113964fd77123285d78dfe3f9 (patch)
treed119ec705776456c59a00535a37448fee1cd83f5 /input.c
parente09625e38b361b8ce0b8fa88851f447144f1a718 (diff)
parent05802a6fe309e3b4559286ca5ce3c51f7367d661 (diff)
downloadrtmux-130b77edc737fcd113964fd77123285d78dfe3f9.tar.gz
rtmux-130b77edc737fcd113964fd77123285d78dfe3f9.tar.bz2
rtmux-130b77edc737fcd113964fd77123285d78dfe3f9.zip
Merge branch 'obsd-master'
Diffstat (limited to 'input.c')
-rw-r--r--input.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/input.c b/input.c
index 26eb1686..b96ac7ef 100644
--- a/input.c
+++ b/input.c
@@ -222,6 +222,7 @@ enum input_csi_type {
INPUT_CSI_SGR,
INPUT_CSI_SM,
INPUT_CSI_SM_PRIVATE,
+ INPUT_CSI_SU,
INPUT_CSI_TBC,
INPUT_CSI_VPA,
INPUT_CSI_WINOPS,
@@ -243,6 +244,7 @@ static const struct input_table_entry input_csi_table[] = {
{ 'L', "", INPUT_CSI_IL },
{ 'M', "", INPUT_CSI_DL },
{ 'P', "", INPUT_CSI_DCH },
+ { 'S', "", INPUT_CSI_SU },
{ 'X', "", INPUT_CSI_ECH },
{ 'Z', "", INPUT_CSI_CBT },
{ 'c', "", INPUT_CSI_DA },
@@ -896,6 +898,16 @@ input_parse(struct window_pane *wp)
}
/*
+ * Any state except print stops the current collection. This is
+ * an optimization to avoid checking if the attributes have
+ * changed for every character. It will stop unnecessarily for
+ * sequences that don't make a terminal change, but they should
+ * be the minority.
+ */
+ if (itr->handler != input_print)
+ screen_write_collect_end(&ictx->ctx);
+
+ /*
* Execute the handler, if any. Don't switch state if it
* returns non-zero.
*/
@@ -920,7 +932,6 @@ input_parse(struct window_pane *wp)
/* Split the parameter list (if any). */
static int
input_split(struct input_ctx *ictx)
-
{
const char *errstr;
char *ptr, *out;
@@ -1021,7 +1032,7 @@ input_print(struct input_ctx *ictx)
ictx->cell.cell.attr &= ~GRID_ATTR_CHARSET;
utf8_set(&ictx->cell.cell.data, ictx->ch);
- screen_write_cell(&ictx->ctx, &ictx->cell.cell);
+ screen_write_collect_add(&ictx->ctx, &ictx->cell.cell);
ictx->cell.cell.attr &= ~GRID_ATTR_CHARSET;
@@ -1404,6 +1415,9 @@ input_csi_dispatch(struct input_ctx *ictx)
case INPUT_CSI_SM_PRIVATE:
input_csi_dispatch_sm_private(ictx);
break;
+ case INPUT_CSI_SU:
+ screen_write_scrollup(sctx, input_get(ictx, 0, 1, 1));
+ break;
case INPUT_CSI_TBC:
switch (input_get(ictx, 0, 0, 0)) {
case 0: