summaryrefslogtreecommitdiffstats
path: root/cmd-new-session.c
diff options
context:
space:
mode:
authornicm <nicm>2017-04-22 10:26:44 +0000
committernicm <nicm>2017-04-22 10:26:44 +0000
commita4eaac359a244a2036265c81c74bc4cd46e05a76 (patch)
treef4a5aa0ab388e0ae486f45902181b831a1a6a880 /cmd-new-session.c
parentee45a8a149e1a3c8fe7c232a9e32f3a007e21bee (diff)
new -A should use the session name.
Diffstat (limited to 'cmd-new-session.c')
-rw-r--r--cmd-new-session.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c
index 8c347ce6..1813288d 100644
--- a/cmd-new-session.c
+++ b/cmd-new-session.c
@@ -83,8 +83,8 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
if (self->entry == &cmd_has_session_entry) {
/*
- * cmd_prepare() will fail if the session cannot be found,
- * hence always return success here.
+ * cmd_find_target() will fail if the session cannot be found,
+ * so always return success here.
*/
return (CMD_RETURN_NORMAL);
}
@@ -102,15 +102,8 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
}
if ((as = session_find(newname)) != NULL) {
if (args_has(args, 'A')) {
- /*
- * This item is now destined for
- * attach-session. Because attach-session will
- * have already been prepared, copy this
- * session into its tflag so it can be used.
- */
- cmd_find_from_session(&item->target, as);
return (cmd_attach_session(item,
- args_get(args, 't'), args_has(args, 'D'),
+ newname, args_has(args, 'D'),
0, NULL, args_has(args, 'E')));
}
cmdq_error(item, "duplicate session: %s", newname);