summaryrefslogtreecommitdiffstats
path: root/input.c
diff options
context:
space:
mode:
authornicm <nicm>2022-08-02 11:09:26 +0000
committernicm <nicm>2022-08-02 11:09:26 +0000
commit42ba6c1b229c92256274e848e9c5ff1d59d9081b (patch)
tree2fc80315e93cdcfcf5e1e488b20a6073d5597331 /input.c
parent33c59100aeb49894550b97cce268f46032f4c8d6 (diff)
Add a third state "all" to allow-passthrough to work even in invisible
panes, from Sergei Grechanik in GitHub issue 3274.
Diffstat (limited to 'input.c')
-rw-r--r--input.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/input.c b/input.c
index 4252428b..d8b334de 100644
--- a/input.c
+++ b/input.c
@@ -2242,22 +2242,27 @@ static int
input_dcs_dispatch(struct input_ctx *ictx)
{
struct window_pane *wp = ictx->wp;
+ struct options *oo = wp->options;
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;
+ long long allow_passthrough = 0;
if (wp == NULL)
return (0);
if (ictx->flags & INPUT_DISCARD)
return (0);
- if (!options_get_number(ictx->wp->options, "allow-passthrough"))
+ allow_passthrough = options_get_number(oo, "allow-passthrough");
+ if (!allow_passthrough)
return (0);
log_debug("%s: \"%s\"", __func__, buf);
- if (len >= prefixlen && strncmp(buf, prefix, prefixlen) == 0)
- screen_write_rawstring(sctx, buf + prefixlen, len - prefixlen);
+ if (len >= prefixlen && strncmp(buf, prefix, prefixlen) == 0) {
+ screen_write_rawstring(sctx, buf + prefixlen, len - prefixlen,
+ allow_passthrough == 2);
+ }
return (0);
}