aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authornicm <nicm>2017-02-08 17:31:09 +0000
committernicm <nicm>2017-02-08 17:31:09 +0000
commite100d465daefd20da0bb5eea87c4b4896badff16 (patch)
treeff477fbaf93b7acbe2245fe02b1bbf906a6d159a /tty.c
parent13a0b6bb3fe05454cace81f5ec7624f6fd9021a5 (diff)
downloadrtmux-e100d465daefd20da0bb5eea87c4b4896badff16.tar.gz
rtmux-e100d465daefd20da0bb5eea87c4b4896badff16.tar.bz2
rtmux-e100d465daefd20da0bb5eea87c4b4896badff16.zip
Add support for scroll up escape sequence (CSI S) and use it when
possible instead of sending individual line feeds.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/tty.c b/tty.c
index 508e4bac..40bd7a40 100644
--- a/tty.c
+++ b/tty.c
@@ -1022,6 +1022,32 @@ tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
}
void
+tty_cmd_scrollup(struct tty *tty, const struct tty_ctx *ctx)
+{
+ struct window_pane *wp = ctx->wp;
+ u_int i;
+
+ if ((!tty_pane_full_width(tty, ctx) && !tty_use_margin(tty)) ||
+ tty_fake_bce(tty, wp, ctx->bg) ||
+ !tty_term_has(tty->term, TTYC_CSR)) {
+ tty_redraw_region(tty, ctx);
+ return;
+ }
+
+ tty_attributes(tty, &grid_default_cell, wp);
+
+ tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
+ tty_margin_pane(tty, ctx);
+
+ if (ctx->num == 1 || !tty_term_has(tty->term, TTYC_INDN)) {
+ tty_cursor(tty, tty->rright, ctx->yoff + tty->rlower);
+ for (i = 0; i < ctx->num; i++)
+ tty_putc(tty, '\n');
+ } else
+ tty_putcode1(tty, TTYC_INDN, ctx->num);
+}
+
+void
tty_cmd_clearendofscreen(struct tty *tty, const struct tty_ctx *ctx)
{
struct window_pane *wp = ctx->wp;