summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tty.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2022-08-02 11:09:27 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2022-08-02 11:09:27 +0000
commit4744f78fbcd877d7e89b0a2a599ffb6d0efe68d1 (patch)
treefde12ec95988b2b5d0496b4bcc4836948481e799 /usr.bin/tmux/tty.c
parente525880fe48bba107f7a0cc0fa35148a9a5ce95d (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 'usr.bin/tmux/tty.c')
-rw-r--r--usr.bin/tmux/tty.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index e029c9c2710..4077b9ad528 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.422 2022/07/06 07:36:36 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.423 2022/08/02 11:09:26 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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);
}
}