diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-10-22 20:04:22 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-10-22 20:04:22 +0000 |
commit | 5c891a01c345a36982404a82bee072e829efce60 (patch) | |
tree | e1a0b08e0e2e52710bdb77edb80752eb7bb58508 /usr.bin/tmux | |
parent | 416efcac243a4f42cfbc890268962739f73caa49 (diff) |
The client buffers have to be checked after every event in order to catch the
escape timers and properly reset the cursor.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/server-client.c | 73 |
1 files changed, 37 insertions, 36 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 4ea25a55e1f..43400ff480f 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.1 2009/10/22 19:41:51 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.2 2009/10/22 20:04:21 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -175,7 +175,6 @@ server_client_callback(int fd, int events, void *data) if (buffer_poll(fd, events, c->tty.in, c->tty.out) != 0) goto client_lost; - server_client_handle_data(c); } return; @@ -184,7 +183,42 @@ client_lost: server_client_lost(c); } -/* Input data from client. */ +/* Client functions that need to happen every loop. */ +void +server_client_loop(void) +{ + struct client *c; + struct window *w; + struct window_pane *wp; + u_int i; + + for (i = 0; i < ARRAY_LENGTH(&clients); i++) { + c = ARRAY_ITEM(&clients, i); + if (c == NULL || c->session == NULL) + continue; + + server_client_check_timers(c); + server_client_check_redraw(c); + + server_client_handle_data(c); + } + + /* + * Any windows will have been redrawn as part of clients, so clear + * their flags now. + */ + for (i = 0; i < ARRAY_LENGTH(&windows); i++) { + w = ARRAY_ITEM(&windows, i); + if (w == NULL) + continue; + + w->flags &= ~WINDOW_REDRAW; + TAILQ_FOREACH(wp, &w->panes, entry) + wp->flags &= ~PANE_REDRAW; + } +} + +/* Handle data input or output from client. */ void server_client_handle_data(struct client *c) { @@ -338,39 +372,6 @@ server_client_handle_data(struct client *c) tty_reset(&c->tty); } -/* Client functions that need to happen every loop. */ -void -server_client_loop(void) -{ - struct client *c; - struct window *w; - struct window_pane *wp; - u_int i; - - for (i = 0; i < ARRAY_LENGTH(&clients); i++) { - c = ARRAY_ITEM(&clients, i); - if (c == NULL || c->session == NULL) - continue; - - server_client_check_timers(c); - server_client_check_redraw(c); - } - - /* - * Any windows will have been redrawn as part of clients, so clear - * their flags now. - */ - for (i = 0; i < ARRAY_LENGTH(&windows); i++) { - w = ARRAY_ITEM(&windows, i); - if (w == NULL) - continue; - - w->flags &= ~WINDOW_REDRAW; - TAILQ_FOREACH(wp, &w->panes, entry) - wp->flags &= ~PANE_REDRAW; - } -} - /* Check for client redraws. */ void server_client_check_redraw(struct client *c) |