summaryrefslogtreecommitdiffstats
path: root/input-keys.c
diff options
context:
space:
mode:
authornicm <nicm>2023-01-12 18:49:11 +0000
committernicm <nicm>2023-01-12 18:49:11 +0000
commit483cc77c1cbc6898fef143c8100945139c14a92c (patch)
treef8b23ceaff411416bf42a6c298133d577fa8fed5 /input-keys.c
parentb41892622de3a2383ff5b419364530f08223558e (diff)
Have tmux recognise pasted texts wrapped in bracket paste sequences,
rather than only forwarding them to the program inside. From Andrew Onyshchuk in GitHub issue 3431.
Diffstat (limited to 'input-keys.c')
-rw-r--r--input-keys.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/input-keys.c b/input-keys.c
index 93123b33..f3281b0e 100644
--- a/input-keys.c
+++ b/input-keys.c
@@ -497,6 +497,9 @@ input_key(struct screen *s, struct bufferevent *bev, key_code key)
ike = input_key_get(key & ~KEYC_EXTENDED);
if (ike != NULL) {
log_debug("found key 0x%llx: \"%s\"", key, ike->data);
+ if ((key == KEYC_PASTE_START || key == KEYC_PASTE_END) &&
+ (~s->mode & MODE_BRACKETPASTE))
+ return (0);
if ((key & KEYC_META) && (~key & KEYC_IMPLIED_META))
input_key_write(__func__, bev, "\033", 1);
input_key_write(__func__, bev, ike->data, strlen(ike->data));