aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authornicm <nicm>2022-02-15 13:11:29 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2022-04-06 14:19:49 +0100
commiteabbc80b75ef8e02653c2728d7f646fc6a8f558f (patch)
treea76e96db8d8802ab166c57affcced9411fbb81ea /input.c
parent190b88fcabc413485584bffed6d8ed8b61db1b1f (diff)
downloadrtmux-eabbc80b75ef8e02653c2728d7f646fc6a8f558f.tar.gz
rtmux-eabbc80b75ef8e02653c2728d7f646fc6a8f558f.tar.bz2
rtmux-eabbc80b75ef8e02653c2728d7f646fc6a8f558f.zip
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 'input.c')
-rw-r--r--input.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/input.c b/input.c
index 16f31ad7..5adc694d 100644
--- a/input.c
+++ b/input.c
@@ -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)