aboutsummaryrefslogtreecommitdiff
path: root/tty-keys.c
diff options
context:
space:
mode:
authornicm <nicm>2022-02-15 13:03:02 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2022-04-06 14:19:49 +0100
commit190b88fcabc413485584bffed6d8ed8b61db1b1f (patch)
tree9fba11c623e2742c50966bfff2d25abe52a7ed8a /tty-keys.c
parent2adbe3ec1606806e31c74507cfa0225327e27225 (diff)
downloadrtmux-190b88fcabc413485584bffed6d8ed8b61db1b1f.tar.gz
rtmux-190b88fcabc413485584bffed6d8ed8b61db1b1f.tar.bz2
rtmux-190b88fcabc413485584bffed6d8ed8b61db1b1f.zip
Do not create a buffer from an OSC 52 response if we have not sent a
query.
Diffstat (limited to 'tty-keys.c')
-rw-r--r--tty-keys.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tty-keys.c b/tty-keys.c
index 65b600c0..5d950078 100644
--- a/tty-keys.c
+++ b/tty-keys.c
@@ -1217,6 +1217,11 @@ tty_keys_clipboard(__unused struct tty *tty, const char *buf, size_t len,
buf++;
end--;
+ /* If we did not request this, ignore it. */
+ if (~tty->flags & TTY_OSC52QUERY)
+ return (0);
+ tty->flags &= ~TTY_OSC52QUERY;
+
/* It has to be a string so copy it. */
copy = xmalloc(end + 1);
memcpy(copy, buf, end);