summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2016-02-04 14:11:21 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2016-02-04 14:11:21 +0000
commit59e32784feed2d28029aee4a28d5bebc4014abec (patch)
treef2f8f523fc166a1cabbb8a7ed2ff240286a54551 /usr.bin/tmux
parent182a62370da94bf587305d08af9d00b5abedc1d5 (diff)
Set up -t flag properly when passing new-session -A off to
attach-session, GitHub issue 295.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/cmd-new-session.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-new-session.c b/usr.bin/tmux/cmd-new-session.c
index a6a4fa78eb0..63978c8f184 100644
--- a/usr.bin/tmux/cmd-new-session.c
+++ b/usr.bin/tmux/cmd-new-session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-new-session.c,v 1.85 2016/01/31 09:52:01 nicm Exp $ */
+/* $OpenBSD: cmd-new-session.c,v 1.86 2016/02/04 14:11:20 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -68,7 +68,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
struct client *c = cmdq->client;
- struct session *s, *attach_sess;
+ struct session *s, *as;
struct session *groupwith = cmdq->state.tflag.s;
struct window *w;
struct environ *env;
@@ -100,7 +100,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
cmdq_error(cmdq, "bad session name: %s", newname);
return (CMD_RETURN_ERROR);
}
- if ((attach_sess = session_find(newname)) != NULL) {
+ if ((as = session_find(newname)) != NULL) {
if (args_has(args, 'A')) {
/*
* This cmdq is now destined for
@@ -108,7 +108,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
* will have already been prepared, copy this
* session into its tflag so it can be used.
*/
- cmdq->state.tflag.s = attach_sess;
+ cmd_find_from_session(&cmdq->state.tflag, as);
return (cmd_attach_session(cmdq,
args_has(args, 'D'), 0, NULL,
args_has(args, 'E')));