=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-detach-client.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- src/usr.bin/tmux/cmd-detach-client.c 2014/10/20 22:29:25 1.17 +++ src/usr.bin/tmux/cmd-detach-client.c 2014/10/20 23:01:51 1.18 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-detach-client.c,v 1.17 2014/10/20 22:29:25 nicm Exp $ */ +/* $OpenBSD: cmd-detach-client.c,v 1.18 2014/10/20 23:01:51 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -36,6 +36,14 @@ 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 +}; + enum cmd_retval cmd_detach_client_exec(struct cmd *self, struct cmd_q *cmdq) { @@ -44,6 +52,15 @@ struct session *s; 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;