diff options
author | Tiago Cunha <tcunha@gmx.com> | 2012-05-12 15:00:19 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2012-05-12 15:00:19 +0000 |
commit | 1340c012b05695fea9e2ee9d07b477c7d8150129 (patch) | |
tree | 00f7fb1e4442dbe47b7a67a4a791a9b287f92e32 /cmd-attach-session.c | |
parent | 2f0db58777e2293d0aa6d96c1d59660b541ee2db (diff) | |
download | rtmux-1340c012b05695fea9e2ee9d07b477c7d8150129.tar.gz rtmux-1340c012b05695fea9e2ee9d07b477c7d8150129.tar.bz2 rtmux-1340c012b05695fea9e2ee9d07b477c7d8150129.zip |
Sync OpenBSD patchset 1111:
Add a helper function to open the terminal for attach-/new-session.
Diffstat (limited to 'cmd-attach-session.c')
-rw-r--r-- | cmd-attach-session.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/cmd-attach-session.c b/cmd-attach-session.c index 54c4051f..cc2006f1 100644 --- a/cmd-attach-session.c +++ b/cmd-attach-session.c @@ -43,7 +43,7 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx) struct session *s; struct client *c; const char *update; - char *overrides, *cause; + char *cause; u_int i; if (RB_EMPTY(&sessions)) { @@ -79,15 +79,8 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx) server_redraw_client(ctx->curclient); s->curw->flags &= ~WINLINK_ALERTFLAGS; } else { - if (!(ctx->cmdclient->flags & CLIENT_TERMINAL)) { - ctx->error(ctx, "not a terminal"); - return (-1); - } - - overrides = - options_get_string(&s->options, "terminal-overrides"); - if (tty_open(&ctx->cmdclient->tty, overrides, &cause) != 0) { - ctx->error(ctx, "terminal open failed: %s", cause); + if (server_client_open(ctx->cmdclient, s, &cause) != 0) { + ctx->error(ctx, "open terminal failed: %s", cause); xfree(cause); return (-1); } |