summaryrefslogtreecommitdiffstats
path: root/cmd-new-session.c
diff options
context:
space:
mode:
authornicm <nicm>2016-02-04 14:11:20 +0000
committernicm <nicm>2016-02-04 14:11:20 +0000
commitbdb8bb790ed53c0ea134c690c8f55b449eefbd3f (patch)
tree4600d6a8db08ee288a6684f252bad4b95ad3df49 /cmd-new-session.c
parent97882f9ce27d615769d3140ef77ddfb47b17a89b (diff)
Set up -t flag properly when passing new-session -A off to
attach-session, GitHub issue 295.
Diffstat (limited to 'cmd-new-session.c')
-rw-r--r--cmd-new-session.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c
index ecbc5983..291107bc 100644
--- a/cmd-new-session.c
+++ b/cmd-new-session.c
@@ -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')));