From c12711affd5d5124f05fc0f6e08ad1bb4d27e6e5 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 28 Apr 2017 13:39:59 +0000 Subject: [PATCH 1/2] Default for xterm-keys was wrong, stop documenting it. --- tmux.1 | 1 - 1 file changed, 1 deletion(-) diff --git a/tmux.1 b/tmux.1 index 04d98dae..fe251802 100644 --- a/tmux.1 +++ b/tmux.1 @@ -3195,7 +3195,6 @@ will generate .Xr xterm 1 -style function key sequences; these have a number included to indicate modifiers such as Shift, Alt or Ctrl. -The default is off. .El .It Xo Ic show-options .Op Fl gqsvw From 54e2205e545d72d8d9ccaadfd4d1212bafb2f41b Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 28 Apr 2017 17:58:44 +0000 Subject: [PATCH 2/2] Konsole incorrectly ignores SU (CSI S) if the parameter is bigger than the scroll region, so clamp it. Reported by Moritz Bunkus. --- tty.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tty.c b/tty.c index fda297c1..e951f25c 100644 --- a/tty.c +++ b/tty.c @@ -1117,7 +1117,7 @@ void tty_cmd_scrollup(struct tty *tty, const struct tty_ctx *ctx) { struct window_pane *wp = ctx->wp; - u_int i; + u_int i, lines; if ((!tty_pane_full_width(tty, ctx) && !tty_use_margin(tty)) || tty_fake_bce(tty, wp, 8) || @@ -1131,12 +1131,21 @@ tty_cmd_scrollup(struct tty *tty, const struct tty_ctx *ctx) 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)) { + /* + * Konsole has a bug where it will ignore SU if the parameter is more + * than the height of the scroll region. Clamping the parameter doesn't + * hurt in any case. + */ + lines = tty->rlower - tty->rupper; + if (lines > ctx->num) + lines = ctx->num; + + if (lines == 1 || !tty_term_has(tty->term, TTYC_INDN)) { tty_cursor(tty, tty->rright, tty->rlower); - for (i = 0; i < ctx->num; i++) + for (i = 0; i < lines; i++) tty_putc(tty, '\n'); } else - tty_putcode1(tty, TTYC_INDN, ctx->num); + tty_putcode1(tty, TTYC_INDN, lines); } void