Big internal reorganisation to move tty control into parent.

This commit is contained in:
Nicholas Marriott
2007-11-27 19:23:34 +00:00
parent 97eca99d0b
commit 76c8a590db
30 changed files with 1577 additions and 1922 deletions

View File

@ -1,4 +1,4 @@
/* $Id: cmd-attach-session.c,v 1.9 2007-11-16 21:12:31 nicm Exp $ */
/* $Id: cmd-attach-session.c,v 1.10 2007-11-27 19:23:33 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -83,6 +83,7 @@ void
cmd_attach_session_exec(void *ptr, struct cmd_ctx *ctx)
{
struct cmd_attach_session_data *data = ptr;
char *cause;
if (ctx->flags & CMD_KEY)
return;
@ -92,6 +93,12 @@ cmd_attach_session_exec(void *ptr, struct cmd_ctx *ctx)
return;
}
if (tty_open(&ctx->cmdclient->tty, &cause) != 0) {
ctx->error(ctx, "%s", cause);
xfree(cause);
return;
}
if (data->flag_detach)
server_write_session(ctx->session, MSG_DETACH, NULL, 0);
ctx->cmdclient->session = ctx->session;