From 42ba6c1b229c92256274e848e9c5ff1d59d9081b Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 2 Aug 2022 11:09:26 +0000 Subject: Add a third state "all" to allow-passthrough to work even in invisible panes, from Sergei Grechanik in GitHub issue 3274. --- tty.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'tty.c') diff --git a/tty.c b/tty.c index 1f373821..a7ad536f 100644 --- a/tty.c +++ b/tty.c @@ -1626,13 +1626,20 @@ tty_write(void (*cmdfn)(struct tty *, const struct tty_ctx *), if (ctx->set_client_cb == NULL) return; TAILQ_FOREACH(c, &clients, entry) { - if (!tty_client_ready(c)) - continue; - state = ctx->set_client_cb(ctx, c); - if (state == -1) - break; - if (state == 0) - continue; + if (ctx->allow_invisible_panes) { + if (c->session == NULL || + c->tty.term == NULL || + c->flags & CLIENT_SUSPENDED) + continue; + } else { + if (!tty_client_ready(c)) + continue; + state = ctx->set_client_cb(ctx, c); + if (state == -1) + break; + if (state == 0) + continue; + } cmdfn(&c->tty, ctx); } } -- cgit