Some other ctrl keys need to be translated with extended keys on.

This commit is contained in:
nicm 2020-05-19 10:59:09 +00:00
parent 574a9e4b6c
commit 8425084b8a
2 changed files with 30 additions and 5 deletions

View File

@ -498,10 +498,35 @@ input_key(struct screen *s, struct bufferevent *bev, key_code key)
/* No builtin key sequence; construct an extended key sequence. */ /* No builtin key sequence; construct an extended key sequence. */
if (~s->mode & MODE_KEXTENDED) { if (~s->mode & MODE_KEXTENDED) {
if ((key & KEYC_MASK_MODIFIERS) == KEYC_CTRL && justkey = (key & KEYC_MASK_KEY);
(key & KEYC_MASK_KEY) < KEYC_BASE) if ((key & KEYC_MASK_MODIFIERS) != KEYC_CTRL)
return (input_key(s, bev, key & ~KEYC_CTRL)); goto missing;
goto missing; switch (justkey) {
case ' ':
case '2':
key = 0||(key & ~KEYC_MASK_KEY);
break;
case '|':
key = 28|(key & ~KEYC_MASK_KEY);
break;
case '6':
key = 30|(key & ~KEYC_MASK_KEY);
break;
case '-':
case '/':
key = 31|(key & ~KEYC_MASK_KEY);
break;
case '?':
key = 127|(key & ~KEYC_MASK_KEY);
break;
default:
if (justkey >= 'A' && justkey <= '_')
key = (justkey - 'A')|(key & ~KEYC_MASK_KEY);
else if (justkey >= 'a' && justkey <= '~')
key = (justkey - 96)|(key & ~KEYC_MASK_KEY);
break;
}
return (input_key(s, bev, key & ~KEYC_CTRL));
} }
outkey = (key & KEYC_MASK_KEY); outkey = (key & KEYC_MASK_KEY);
switch (key & KEYC_MASK_MODIFIERS) { switch (key & KEYC_MASK_MODIFIERS) {

View File

@ -343,7 +343,7 @@ tty_default_features(int *feat, const char *name, u_int version)
.features = "256,bpaste,ccolour,cstyle,title" .features = "256,bpaste,ccolour,cstyle,title"
}, },
{ .name = "iTerm2", { .name = "iTerm2",
.features = TTY_FEATURES_BASE_MODERN_XTERM ",cstyle,margins,sync" .features = TTY_FEATURES_BASE_MODERN_XTERM ",cstyle,extkeys,margins,sync"
}, },
{ .name = "XTerm", { .name = "XTerm",
.features = TTY_FEATURES_BASE_MODERN_XTERM ",ccolour,cstyle,extkeys,focus,margins,rectfill" .features = TTY_FEATURES_BASE_MODERN_XTERM ",ccolour,cstyle,extkeys,focus,margins,rectfill"