From 715835510beff71cb666600e0c139f82fd14cc2d Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 13 Apr 2021 05:23:34 +0000 Subject: [PATCH 1/2] Handle C-Tab correctly with extended keys, GitHub issue 2642. --- tty-keys.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tty-keys.c b/tty-keys.c index e88ff227..c0aceb32 100644 --- a/tty-keys.c +++ b/tty-keys.c @@ -953,11 +953,14 @@ tty_keys_extended_key(struct tty *tty, const char *buf, size_t len, * Don't allow both KEYC_CTRL and as an implied modifier. Also convert * C-X into C-x and so on. */ - if (nkey & KEYC_CTRL){ + if (nkey & KEYC_CTRL) { onlykey = (nkey & KEYC_MASK_KEY); - if (onlykey < 32) - onlykey = (nkey & ~KEYC_CTRL); - else { + if (onlykey < 32) { + if (onlykey != 9) + onlykey = (nkey & ~KEYC_CTRL); + else + onlykey = (9|KEYC_CTRL); + } else { if (onlykey >= 97 && onlykey <= 122) onlykey -= 96; else if (onlykey >= 64 && onlykey <= 95) From ff860e5fe41bdef7a4a0ba74f9be4a612c546656 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 13 Apr 2021 05:25:05 +0000 Subject: [PATCH 2/2] Move mode set/reset after sync so cursor doesn't flicker, from Avi Halachmi. --- screen-redraw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/screen-redraw.c b/screen-redraw.c index 6ddabc52..cf3e29f6 100644 --- a/screen-redraw.c +++ b/screen-redraw.c @@ -604,8 +604,8 @@ screen_redraw_screen(struct client *c) return; screen_redraw_set_context(c, &ctx); - tty_update_mode(&c->tty, c->tty.mode, NULL); tty_sync_start(&c->tty); + tty_update_mode(&c->tty, c->tty.mode, NULL); if (flags & (CLIENT_REDRAWWINDOW|CLIENT_REDRAWBORDERS)) { log_debug("%s: redrawing borders", c->name); @@ -640,8 +640,8 @@ screen_redraw_pane(struct client *c, struct window_pane *wp) return; screen_redraw_set_context(c, &ctx); - tty_update_mode(&c->tty, c->tty.mode, NULL); tty_sync_start(&c->tty); + tty_update_mode(&c->tty, c->tty.mode, NULL); screen_redraw_draw_pane(&ctx, wp);