summaryrefslogtreecommitdiffstats
path: root/tty.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-08-14 08:58:25 +0000
committerNicholas Marriott <nicm@openbsd.org>2012-08-14 08:58:25 +0000
commitf61fc576d922b4eb3780933a7808d35bd3725917 (patch)
tree2cd76f47e182b56e30922d1214c774ca4b251806 /tty.c
parent73c678553809956f428fec9db3210a5576d5883f (diff)
Tidy up tty_write, from Sean Estabrooks.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/tty.c b/tty.c
index d40e95d7..68d23fc2 100644
--- a/tty.c
+++ b/tty.c
@@ -667,7 +667,6 @@ tty_write(
{
struct window_pane *wp = ctx->wp;
struct client *c;
- struct session *s;
u_int i;
/* wp can be NULL if updating the screen but not the terminal. */
@@ -681,25 +680,19 @@ tty_write(
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
c = ARRAY_ITEM(&clients, i);
- if (c == NULL || c->session == NULL)
+ if (c == NULL || c->session == NULL || c->tty.term == NULL)
continue;
- if (c->flags & CLIENT_SUSPENDED)
+ if (c->flags & (CLIENT_SUSPENDED|TTY_FREEZE))
+ continue;
+ if (c->session->curw->window != wp->window)
continue;
- s = c->session;
-
- if (s->curw->window == wp->window) {
- if (c->tty.term == NULL)
- continue;
- if (c->tty.flags & TTY_FREEZE)
- continue;
- ctx->xoff = wp->xoff;
- ctx->yoff = wp->yoff;
- if (status_at_line(c) == 0)
- ctx->yoff++;
+ ctx->xoff = wp->xoff;
+ ctx->yoff = wp->yoff;
+ if (status_at_line(c) == 0)
+ ctx->yoff++;
- cmdfn(&c->tty, ctx);
- }
+ cmdfn(&c->tty, ctx);
}
}