aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2022-11-02 08:01:11 +0000
committerThomas Adam <thomas@xteddy.org>2022-11-02 08:01:11 +0000
commitdbfbd8a195707a8550d59f9576fbbafe1045556c (patch)
tree892fa43ade8ddc970159855005ca3621a21c028e
parent36896f6dd0d49d91bcc9c398c68a33818626532c (diff)
parent9614f5156079773b338a13e95ec932cc7c95b031 (diff)
downloadrtmux-dbfbd8a195707a8550d59f9576fbbafe1045556c.tar.gz
rtmux-dbfbd8a195707a8550d59f9576fbbafe1045556c.tar.bz2
rtmux-dbfbd8a195707a8550d59f9576fbbafe1045556c.zip
Merge branch 'obsd-master'
-rw-r--r--input-keys.c9
-rw-r--r--tty-keys.c4
2 files changed, 7 insertions, 6 deletions
diff --git a/input-keys.c b/input-keys.c
index aa508028..208eb360 100644
--- a/input-keys.c
+++ b/input-keys.c
@@ -430,7 +430,7 @@ input_key_write(const char *from, struct bufferevent *bev, const char *data,
int
input_key(struct screen *s, struct bufferevent *bev, key_code key)
{
- struct input_key_entry *ike;
+ struct input_key_entry *ike = NULL;
key_code justkey, newkey, outkey, modifiers;
struct utf8_data ud;
char tmp[64], modifier;
@@ -482,9 +482,10 @@ input_key(struct screen *s, struct bufferevent *bev, key_code key)
key &= ~KEYC_KEYPAD;
if (~s->mode & MODE_KCURSOR)
key &= ~KEYC_CURSOR;
- if (~s->mode & MODE_KEXTENDED)
- key &= ~KEYC_EXTENDED;
- ike = input_key_get(key);
+ if (s->mode & MODE_KEXTENDED)
+ ike = input_key_get(key|KEYC_EXTENDED);
+ if (ike == NULL)
+ ike = input_key_get(key);
if (ike == NULL && (key & KEYC_META) && (~key & KEYC_IMPLIED_META))
ike = input_key_get(key & ~KEYC_META);
if (ike == NULL && (key & KEYC_CURSOR))
diff --git a/tty-keys.c b/tty-keys.c
index db82754f..cb8efd49 100644
--- a/tty-keys.c
+++ b/tty-keys.c
@@ -210,7 +210,7 @@ static const struct tty_default_key_raw tty_default_raw_keys[] = {
{ "\033[201~", KEYC_PASTE_END },
/* Extended keys. */
- { "\033[1;5Z", '\011'|KEYC_CTRL|KEYC_SHIFT|KEYC_EXTENDED },
+ { "\033[1;5Z", '\011'|KEYC_CTRL|KEYC_SHIFT },
};
/* Default xterm keys. */
@@ -977,7 +977,7 @@ tty_keys_extended_key(struct tty *tty, const char *buf, size_t len,
log_debug("%s: extended key %.*s is %llx (%s)", c->name,
(int)*size, buf, nkey, key_string_lookup_key(nkey, 1));
}
- *key = nkey|KEYC_EXTENDED;
+ *key = nkey;
return (0);
}