summaryrefslogtreecommitdiffstats
path: root/server-msg.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-01-18 12:09:42 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-01-18 12:09:42 +0000
commit8ea49712fd4c9f158128832e6c93308afeb1bd4d (patch)
treea7a4e84c2722ba9f3848f4bbe377c1e38ed14d1c /server-msg.c
parent273d63040ab6f0124518fcdb1ad9f2f10c84c2de (diff)
suspend-client command and suspend client when ^Z key binding is used.
Diffstat (limited to 'server-msg.c')
-rw-r--r--server-msg.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/server-msg.c b/server-msg.c
index 43293a13..a91c8397 100644
--- a/server-msg.c
+++ b/server-msg.c
@@ -1,4 +1,4 @@
-/* $Id: server-msg.c,v 1.57 2009-01-11 23:31:46 nicm Exp $ */
+/* $Id: server-msg.c,v 1.58 2009-01-18 12:09:42 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -31,6 +31,7 @@ int server_msg_fn_identify(struct hdr *, struct client *);
int server_msg_fn_resize(struct hdr *, struct client *);
int server_msg_fn_exiting(struct hdr *, struct client *);
int server_msg_fn_unlock(struct hdr *, struct client *);
+int server_msg_fn_wakeup(struct hdr *, struct client *);
void printflike2 server_msg_fn_command_error(
struct cmd_ctx *, const char *, ...);
@@ -48,7 +49,8 @@ const struct server_msg server_msg_table[] = {
{ MSG_COMMAND, server_msg_fn_command },
{ MSG_RESIZE, server_msg_fn_resize },
{ MSG_EXITING, server_msg_fn_exiting },
- { MSG_UNLOCK, server_msg_fn_unlock }
+ { MSG_UNLOCK, server_msg_fn_unlock },
+ { MSG_WAKEUP, server_msg_fn_wakeup },
};
int
@@ -242,7 +244,7 @@ server_msg_fn_exiting(struct hdr *hdr, struct client *c)
c->session = NULL;
- tty_close(&c->tty);
+ tty_close(&c->tty, c->flags & CLIENT_SUSPENDED);
server_write_client(c, MSG_EXITED, NULL, 0);
@@ -271,3 +273,18 @@ server_msg_fn_unlock(struct hdr *hdr, struct client *c)
return (0);
}
+
+int
+server_msg_fn_wakeup(struct hdr *hdr, struct client *c)
+{
+ if (hdr->size != 0)
+ fatalx("bad MSG_WAKEUP size");
+
+ log_debug("wakeup msg from client");
+
+ c->flags &= ~CLIENT_SUSPENDED;
+ tty_start_tty(&c->tty);
+ server_redraw_client(c);
+
+ return (0);
+}