summaryrefslogtreecommitdiffstats
path: root/cmd-new-session.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2012-05-12 15:00:19 +0000
committerTiago Cunha <tcunha@gmx.com>2012-05-12 15:00:19 +0000
commit1340c012b05695fea9e2ee9d07b477c7d8150129 (patch)
tree00f7fb1e4442dbe47b7a67a4a791a9b287f92e32 /cmd-new-session.c
parent2f0db58777e2293d0aa6d96c1d59660b541ee2db (diff)
Sync OpenBSD patchset 1111:
Add a helper function to open the terminal for attach-/new-session.
Diffstat (limited to 'cmd-new-session.c')
-rw-r--r--cmd-new-session.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c
index e0c3b64d..e7d21d3b 100644
--- a/cmd-new-session.c
+++ b/cmd-new-session.c
@@ -63,7 +63,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
struct termios tio, *tiop;
struct passwd *pw;
const char *newname, *target, *update, *cwd, *errstr;
- char *overrides, *cmd, *cause;
+ char *cmd, *cause;
int detached, idx;
u_int sx, sy, i;
@@ -128,14 +128,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
/* Open the terminal if necessary. */
if (!detached && ctx->cmdclient != NULL) {
- if (!(ctx->cmdclient->flags & CLIENT_TERMINAL)) {
- ctx->error(ctx, "not a terminal");
- return (-1);
- }
-
- overrides =
- options_get_string(&global_s_options, "terminal-overrides");
- if (tty_open(&ctx->cmdclient->tty, overrides, &cause) != 0) {
+ if (server_client_open(ctx->cmdclient, NULL, &cause) != 0) {
ctx->error(ctx, "open terminal failed: %s", cause);
xfree(cause);
return (-1);