diff options
author | 2012-05-06 07:38:17 +0000 | |
---|---|---|
committer | 2012-05-06 07:38:17 +0000 | |
commit | 68dbe1fa781e3fcf0c246a9641d935851a52f294 (patch) | |
tree | 097a65865855c64184b7fa5475c990954ad807d7 /usr.bin/tmux/cmd-attach-session.c | |
parent | Garbage collect the old int$80 kernel entry point: the last use of (diff) | |
download | wireguard-openbsd-68dbe1fa781e3fcf0c246a9641d935851a52f294.tar.xz wireguard-openbsd-68dbe1fa781e3fcf0c246a9641d935851a52f294.zip |
Add a helper function to open the terminal for attach-/new-session.
Diffstat (limited to 'usr.bin/tmux/cmd-attach-session.c')
-rw-r--r-- | usr.bin/tmux/cmd-attach-session.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/usr.bin/tmux/cmd-attach-session.c b/usr.bin/tmux/cmd-attach-session.c index cbb9d50ea77..b5576890ec2 100644 --- a/usr.bin/tmux/cmd-attach-session.c +++ b/usr.bin/tmux/cmd-attach-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-attach-session.c,v 1.18 2012/03/17 22:35:09 nicm Exp $ */ +/* $OpenBSD: cmd-attach-session.c,v 1.19 2012/05/06 07:38:17 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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); } |