summaryrefslogtreecommitdiffstats
path: root/cmd-new-session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-05-06 07:38:17 +0000
committerNicholas Marriott <nicm@openbsd.org>2012-05-06 07:38:17 +0000
commit37f9bb46d815e8ba6377c3435d72c052267831ed (patch)
tree9dc322b5aed567b82b0b4ac1c1b7f5d1f028bb03 /cmd-new-session.c
parent218b692221b9dd675275ec353364910dfc072151 (diff)
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 d40b5095..c078d1d2 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);