diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-18 12:09:42 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-18 12:09:42 +0000 |
commit | 8ea49712fd4c9f158128832e6c93308afeb1bd4d (patch) | |
tree | a7a4e84c2722ba9f3848f4bbe377c1e38ed14d1c /server.c | |
parent | 273d63040ab6f0124518fcdb1ad9f2f10c84c2de (diff) | |
download | rtmux-8ea49712fd4c9f158128832e6c93308afeb1bd4d.tar.gz rtmux-8ea49712fd4c9f158128832e6c93308afeb1bd4d.tar.bz2 rtmux-8ea49712fd4c9f158128832e6c93308afeb1bd4d.zip |
suspend-client command and suspend client when ^Z key binding is used.
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.106 2009-01-17 17:42:10 nicm Exp $ */ +/* $Id: server.c,v 1.107 2009-01-18 12:09:42 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -484,7 +484,8 @@ server_fill_clients(struct pollfd **pfd) } (*pfd)++; - if (c == NULL || c->tty.fd == -1 || c->session == NULL) + if (c == NULL || c->flags & CLIENT_SUSPENDED || + c->tty.fd == -1 || c->session == NULL) (*pfd)->fd = -1; else { (*pfd)->fd = c->tty.fd; @@ -516,7 +517,8 @@ server_handle_clients(struct pollfd **pfd) } (*pfd)++; - if (c != NULL && c->tty.fd != -1 && c->session != NULL) { + if (c != NULL && !(c->flags & CLIENT_SUSPENDED) && + c->tty.fd != -1 && c->session != NULL) { if (buffer_poll(*pfd, c->tty.in, c->tty.out) != 0) server_lost_client(c); else @@ -602,7 +604,7 @@ server_handle_client(struct client *c) if (c->session == NULL) return; - wp = c->session->curw->window->active; /* could die - do each loop */ + wp = c->session->curw->window->active; /* could die */ server_clear_client_message(c); if (c->prompt_string != NULL) { @@ -686,7 +688,7 @@ server_lost_client(struct client *c) ARRAY_SET(&clients, i, NULL); } - tty_free(&c->tty); + tty_free(&c->tty, c->flags & CLIENT_SUSPENDED); if (c->title != NULL) xfree(c->title); |