summaryrefslogtreecommitdiffstats
path: root/tty.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 /tty.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 'tty.c')
-rw-r--r--tty.c21
1 files changed, 14 insertions, 7 deletions
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);
}
}