Skip to content

Commit

Permalink
Merge branch 'obsd-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasAdam committed May 19, 2020
2 parents e10f5a7 + 8425084 commit fb9e53b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
33 changes: 29 additions & 4 deletions input-keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,10 +497,35 @@ input_key(struct screen *s, struct bufferevent *bev, key_code key)

/* No builtin key sequence; construct an extended key sequence. */
if (~s->mode & MODE_KEXTENDED) {
if ((key & KEYC_MASK_MODIFIERS) == KEYC_CTRL &&
(key & KEYC_MASK_KEY) < KEYC_BASE)
return (input_key(s, bev, key & ~KEYC_CTRL));
goto missing;
justkey = (key & KEYC_MASK_KEY);
if ((key & KEYC_MASK_MODIFIERS) != KEYC_CTRL)
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);
switch (key & KEYC_MASK_MODIFIERS) {
Expand Down
2 changes: 1 addition & 1 deletion tty-features.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ tty_default_features(int *feat, const char *name, u_int version)
.features = "256,bpaste,ccolour,cstyle,title"
},
{ .name = "iTerm2",
.features = TTY_FEATURES_BASE_MODERN_XTERM ",cstyle,margins,sync"
.features = TTY_FEATURES_BASE_MODERN_XTERM ",cstyle,extkeys,margins,sync"
},
{ .name = "XTerm",
.features = TTY_FEATURES_BASE_MODERN_XTERM ",ccolour,cstyle,extkeys,focus,margins,rectfill"
Expand Down

0 comments on commit fb9e53b

Please sign in to comment.