aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authornicm <nicm>2017-02-08 16:45:18 +0000
committernicm <nicm>2017-02-08 16:45:18 +0000
commit13a0b6bb3fe05454cace81f5ec7624f6fd9021a5 (patch)
tree5b61257ae5a17983cc848ca01c1364d77f7dff7e /tty.c
parentd4b006b9faf001de41560db2e8fb890c654598e2 (diff)
downloadrtmux-13a0b6bb3fe05454cace81f5ec7624f6fd9021a5.tar.gz
rtmux-13a0b6bb3fe05454cace81f5ec7624f6fd9021a5.tar.bz2
rtmux-13a0b6bb3fe05454cace81f5ec7624f6fd9021a5.zip
Collect sequences of printable ASCII characters and process them
together instead of handling them one by one. This is significantly faster. Sequences are terminated when we reach the end of the line, fill the internal buffer, or a different character is seen by the input parser (an escape sequence, or UTF-8). Rather than writing collected sequences out immediately, hold them until it is necessary (another screen modification, or we consume all available data). This means we can discard changes that would have no effect (for example, lines that would just be scrolled off the screen or cleared). This reduces the total amount of data we write out to the terminal - not important for fast terminals, but a big help with slow (like xterm).
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tty.c b/tty.c
index 1b7fb55f..508e4bac 100644
--- a/tty.c
+++ b/tty.c
@@ -1170,6 +1170,15 @@ tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx)
}
void
+tty_cmd_cells(struct tty *tty, const struct tty_ctx *ctx)
+{
+ tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
+
+ tty_attributes(tty, ctx->cell, ctx->wp);
+ tty_putn(tty, ctx->ptr, ctx->num, ctx->num);
+}
+
+void
tty_cmd_setselection(struct tty *tty, const struct tty_ctx *ctx)
{
char *buf;