version 1.206, 2022/06/30 09:55:53 |
version 1.207, 2022/08/02 11:09:26 |
|
|
input_dcs_dispatch(struct input_ctx *ictx) |
input_dcs_dispatch(struct input_ctx *ictx) |
{ |
{ |
struct window_pane *wp = ictx->wp; |
struct window_pane *wp = ictx->wp; |
|
struct options *oo = wp->options; |
struct screen_write_ctx *sctx = &ictx->ctx; |
struct screen_write_ctx *sctx = &ictx->ctx; |
u_char *buf = ictx->input_buf; |
u_char *buf = ictx->input_buf; |
size_t len = ictx->input_len; |
size_t len = ictx->input_len; |
const char prefix[] = "tmux;"; |
const char prefix[] = "tmux;"; |
const u_int prefixlen = (sizeof prefix) - 1; |
const u_int prefixlen = (sizeof prefix) - 1; |
|
long long allow_passthrough = 0; |
|
|
if (wp == NULL) |
if (wp == NULL) |
return (0); |
return (0); |
if (ictx->flags & INPUT_DISCARD) |
if (ictx->flags & INPUT_DISCARD) |
return (0); |
return (0); |
if (!options_get_number(ictx->wp->options, "allow-passthrough")) |
allow_passthrough = options_get_number(oo, "allow-passthrough"); |
|
if (!allow_passthrough) |
return (0); |
return (0); |
log_debug("%s: \"%s\"", __func__, buf); |
log_debug("%s: \"%s\"", __func__, buf); |
|
|
if (len >= prefixlen && strncmp(buf, prefix, prefixlen) == 0) |
if (len >= prefixlen && strncmp(buf, prefix, prefixlen) == 0) { |
screen_write_rawstring(sctx, buf + prefixlen, len - prefixlen); |
screen_write_rawstring(sctx, buf + prefixlen, len - prefixlen, |
|
allow_passthrough == 2); |
|
} |
|
|
return (0); |
return (0); |
} |
} |