diff options
author | Thomas Adam <thomas@xteddy.org> | 2015-05-13 09:44:11 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2015-05-13 09:44:11 +0100 |
commit | 00471dc78358bde092df65de5e2c375bf9be7437 (patch) | |
tree | 4db96614bbc7e70dcdeaa307a3280103beee2f9e /tty.c | |
parent | 4165ed96f8f0c494c7bd4f793176e508b6b6581d (diff) | |
parent | 3f4ee98162cd5bb7000f93fec0e631e123b1281d (diff) | |
download | rtmux-00471dc78358bde092df65de5e2c375bf9be7437.tar.gz rtmux-00471dc78358bde092df65de5e2c375bf9be7437.tar.bz2 rtmux-00471dc78358bde092df65de5e2c375bf9be7437.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 26 |
1 files changed, 17 insertions, 9 deletions
@@ -723,9 +723,23 @@ tty_draw_line(struct tty *tty, const struct window_pane *wp, tty_update_mode(tty, tty->mode, s); } +int +tty_client_ready(struct client *c, struct window_pane *wp) +{ + if (c->session == NULL || c->tty.term == NULL) + return (0); + if (c->flags & CLIENT_SUSPENDED) + return (0); + if (c->tty.flags & TTY_FREEZE) + return (0); + if (c->session->curw->window != wp->window) + return (0); + return (1); +} + void -tty_write( - void (*cmdfn)(struct tty *, const struct tty_ctx *), struct tty_ctx *ctx) +tty_write(void (*cmdfn)(struct tty *, const struct tty_ctx *), + struct tty_ctx *ctx) { struct window_pane *wp = ctx->wp; struct client *c; @@ -740,13 +754,7 @@ tty_write( return; TAILQ_FOREACH(c, &clients, entry) { - if (c->session == NULL || c->tty.term == NULL) - continue; - if (c->flags & CLIENT_SUSPENDED) - continue; - if (c->tty.flags & TTY_FREEZE) - continue; - if (c->session->curw->window != wp->window) + if (!tty_client_ready(c, wp)) continue; ctx->xoff = wp->xoff; |