summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2022-11-02 07:36:08 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2022-11-02 07:36:08 +0000
commit880920b192ec79b6d85854dcc3d30c3a6a9a2d79 (patch)
tree13ceda4967a508e96662ba4b4fb4f2c3b38eac37
parent25e0991fac3fb544cdf18903c285de7e16343f0b (diff)
Instead of always setting the extended flag, set it only when searching.
Allows send-keys to work. From Aaron Jensen.
-rw-r--r--usr.bin/tmux/input-keys.c11
-rw-r--r--usr.bin/tmux/tty-keys.c6
2 files changed, 9 insertions, 8 deletions
diff --git a/usr.bin/tmux/input-keys.c b/usr.bin/tmux/input-keys.c
index eb2c8655999..713c6d9c786 100644
--- a/usr.bin/tmux/input-keys.c
+++ b/usr.bin/tmux/input-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: input-keys.c,v 1.91 2022/11/01 09:54:13 nicm Exp $ */
+/* $OpenBSD: input-keys.c,v 1.92 2022/11/02 07:36:07 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -431,7 +431,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;
@@ -483,9 +483,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/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c
index 3d2c0315f49..ab6a29fd754 100644
--- a/usr.bin/tmux/tty-keys.c
+++ b/usr.bin/tmux/tty-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-keys.c,v 1.159 2022/11/01 09:54:13 nicm Exp $ */
+/* $OpenBSD: tty-keys.c,v 1.160 2022/11/02 07:36:07 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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);
}