summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/input.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2022-02-15 13:11:30 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2022-02-15 13:11:30 +0000
commitd0d3e322b42c97fea6d68d70518a306421eabca0 (patch)
treedfbbf382a79a118283d1a1226981db252df910da /usr.bin/tmux/input.c
parent8e48cd7173be4ff06b123b9cf7e583cf50c599d2 (diff)
Add an option (default off) to control the passthrough escape sequence.
Like set-clipboard and allow-rename it is safer to forbid this by default.
Diffstat (limited to 'usr.bin/tmux/input.c')
-rw-r--r--usr.bin/tmux/input.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c
index e01f29a37af..14d8d575594 100644
--- a/usr.bin/tmux/input.c
+++ b/usr.bin/tmux/input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: input.c,v 1.198 2021/12/07 07:28:44 nicm Exp $ */
+/* $OpenBSD: input.c,v 1.199 2022/02/15 13:11:29 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -2235,15 +2235,19 @@ input_enter_dcs(struct input_ctx *ictx)
static int
input_dcs_dispatch(struct input_ctx *ictx)
{
+ struct window_pane *wp = ictx->wp;
struct screen_write_ctx *sctx = &ictx->ctx;
u_char *buf = ictx->input_buf;
size_t len = ictx->input_len;
const char prefix[] = "tmux;";
const u_int prefixlen = (sizeof prefix) - 1;
+ if (wp == NULL)
+ return (0);
if (ictx->flags & INPUT_DISCARD)
return (0);
-
+ if (!options_get_number(ictx->wp->options, "allow-passthrough"))
+ return (0);
log_debug("%s: \"%s\"", __func__, buf);
if (len >= prefixlen && strncmp(buf, prefix, prefixlen) == 0)