diff options
author | 2012-08-14 08:58:25 +0000 | |
---|---|---|
committer | 2012-08-14 08:58:25 +0000 | |
commit | 7cc7677082d058680f959ed3bc20ca0f07b2a8fa (patch) | |
tree | 23322f30d2cbb839b2f93bd90b6825220ae33a3e /usr.bin/tmux/tty.c | |
parent | Use a separate define for each default format template and strip clutter (diff) | |
download | wireguard-openbsd-7cc7677082d058680f959ed3bc20ca0f07b2a8fa.tar.xz wireguard-openbsd-7cc7677082d058680f959ed3bc20ca0f07b2a8fa.zip |
Tidy up tty_write, from Sean Estabrooks.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r-- | usr.bin/tmux/tty.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index e665dcf7cf6..da15fd5a43c 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.138 2012/07/10 11:53:01 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.139 2012/08/14 08:58:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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); } } |