diff options
author | Thomas Adam <thomas@xteddy.org> | 2014-10-21 07:11:44 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2014-10-21 07:11:44 +0100 |
commit | 562af864bd8ab06c416075b5742ce3bbcf6d0610 (patch) | |
tree | 2c3900dd6b284aa52441c3fde9dfdf8383d87b54 /cmd-detach-client.c | |
parent | b6aef2490f086f3404f439308bb1746ec5134e9a (diff) | |
parent | 0a1a88d63caf3a0e8b4440686e73e1f0f690e03c (diff) | |
download | rtmux-562af864bd8ab06c416075b5742ce3bbcf6d0610.tar.gz rtmux-562af864bd8ab06c416075b5742ce3bbcf6d0610.tar.bz2 rtmux-562af864bd8ab06c416075b5742ce3bbcf6d0610.zip |
Merge branch 'obsd-master'
Conflicts:
Makefile
cmd-list-commands.c
cmd-suspend-client.c
job.c
tmux.h
xmalloc.c
Diffstat (limited to 'cmd-detach-client.c')
-rw-r--r-- | cmd-detach-client.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/cmd-detach-client.c b/cmd-detach-client.c index fe4b2397..c5a73517 100644 --- a/cmd-detach-client.c +++ b/cmd-detach-client.c @@ -33,7 +33,14 @@ const struct cmd_entry cmd_detach_client_entry = { "as:t:P", 0, 0, "[-P] [-a] [-s target-session] " CMD_TARGET_CLIENT_USAGE, CMD_READONLY, - NULL, + cmd_detach_client_exec +}; + +const struct cmd_entry cmd_suspend_client_entry = { + "suspend-client", "suspendc", + "t:", 0, 0, + CMD_TARGET_CLIENT_USAGE, + 0, cmd_detach_client_exec }; @@ -46,6 +53,15 @@ cmd_detach_client_exec(struct cmd *self, struct cmd_q *cmdq) enum msgtype msgtype; u_int i; + if (self->entry == &cmd_suspend_client_entry) { + if ((c = cmd_find_client(cmdq, args_get(args, 't'), 0)) == NULL) + return (CMD_RETURN_ERROR); + tty_stop_tty(&c->tty); + c->flags |= CLIENT_SUSPENDED; + server_write_client(c, MSG_SUSPEND, NULL, 0); + return (CMD_RETURN_NORMAL); + } + if (args_has(args, 'P')) msgtype = MSG_DETACHKILL; else |