Add a third state "all" to allow-passthrough to work even in invisible

panes, from Sergei Grechanik in GitHub issue 3274.
This commit is contained in:
nicm
2022-08-02 11:09:26 +00:00
parent 33c59100ae
commit 42ba6c1b22
6 changed files with 67 additions and 33 deletions

21
tty.c
View File

@ -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);
}
}