Add a suspend helper function, and do not allow detaching or suspending

while already doing so.
This commit is contained in:
nicm
2017-04-19 14:00:28 +00:00
parent 689f4bfac2
commit 53fde21bb8
3 changed files with 21 additions and 7 deletions

View File

@ -67,9 +67,7 @@ cmd_detach_client_exec(struct cmd *self, struct cmdq_item *item)
const char *cmd = args_get(args, 'E');
if (self->entry == &cmd_suspend_client_entry) {
tty_stop_tty(&c->tty);
c->flags |= CLIENT_SUSPENDED;
proc_send(c->peer, MSG_SUSPEND, -1, NULL, 0);
server_client_suspend(c);
return (CMD_RETURN_NORMAL);
}