diff options
author | nicm <nicm> | 2019-08-05 06:42:02 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2019-08-26 17:28:24 +0100 |
commit | 79f09b4d855b2339db2c859266135ab1b6368a61 (patch) | |
tree | c5ea8f88c382bdecf9b1b47ece54dc7b27df561d /tty.c | |
parent | e85ea9f67dcecab91599a658ad694d8e08514509 (diff) | |
download | rtmux-79f09b4d855b2339db2c859266135ab1b6368a61.tar.gz rtmux-79f09b4d855b2339db2c859266135ab1b6368a61.tar.bz2 rtmux-79f09b4d855b2339db2c859266135ab1b6368a61.zip |
Add support for the SD (scroll down) escape sequence, GitHub issue 1861.
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 44 |
1 files changed, 40 insertions, 4 deletions
@@ -1558,10 +1558,11 @@ tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx) return; if (ctx->bigger || - !tty_pane_full_width(tty, ctx) || + (!tty_pane_full_width(tty, ctx) && !tty_use_margin(tty)) || tty_fake_bce(tty, wp, 8) || !tty_term_has(tty->term, TTYC_CSR) || - !tty_term_has(tty->term, TTYC_RI) || + (!tty_term_has(tty->term, TTYC_RI) && + !tty_term_has(tty->term, TTYC_RIN)) || ctx->wp->sx == 1 || ctx->wp->sy == 1) { tty_redraw_region(tty, ctx); @@ -1571,10 +1572,13 @@ tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx) tty_default_attributes(tty, wp, ctx->bg); tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower); - tty_margin_off(tty); + tty_margin_pane(tty, ctx); tty_cursor_pane(tty, ctx, ctx->ocx, ctx->orupper); - tty_putcode(tty, TTYC_RI); + if (tty_term_has(tty->term, TTYC_RI)) + tty_putcode(tty, TTYC_RI); + else + tty_putcode1(tty, TTYC_RIN, 1); } void @@ -1653,6 +1657,38 @@ tty_cmd_scrollup(struct tty *tty, const struct tty_ctx *ctx) } void +tty_cmd_scrolldown(struct tty *tty, const struct tty_ctx *ctx) +{ + struct window_pane *wp = ctx->wp; + u_int i; + + if (ctx->bigger || + (!tty_pane_full_width(tty, ctx) && !tty_use_margin(tty)) || + tty_fake_bce(tty, wp, 8) || + !tty_term_has(tty->term, TTYC_CSR) || + (!tty_term_has(tty->term, TTYC_RI) && + !tty_term_has(tty->term, TTYC_RIN)) || + wp->sx == 1 || + wp->sy == 1) { + tty_redraw_region(tty, ctx); + return; + } + + tty_default_attributes(tty, wp, ctx->bg); + + tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower); + tty_margin_pane(tty, ctx); + tty_cursor_pane(tty, ctx, ctx->ocx, ctx->orupper); + + if (tty_term_has(tty->term, TTYC_RIN)) + tty_putcode1(tty, TTYC_RIN, ctx->num); + else { + for (i = 0; i < ctx->num; i++) + tty_putcode(tty, TTYC_RI); + } +} + +void tty_cmd_clearendofscreen(struct tty *tty, const struct tty_ctx *ctx) { struct window_pane *wp = ctx->wp; |