mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 16:28:48 +00:00
new -A should use the session name.
This commit is contained in:
parent
ee45a8a149
commit
a4eaac359a
@ -83,8 +83,8 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
|
|
||||||
if (self->entry == &cmd_has_session_entry) {
|
if (self->entry == &cmd_has_session_entry) {
|
||||||
/*
|
/*
|
||||||
* cmd_prepare() will fail if the session cannot be found,
|
* cmd_find_target() will fail if the session cannot be found,
|
||||||
* hence always return success here.
|
* so always return success here.
|
||||||
*/
|
*/
|
||||||
return (CMD_RETURN_NORMAL);
|
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 ((as = session_find(newname)) != NULL) {
|
||||||
if (args_has(args, 'A')) {
|
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,
|
return (cmd_attach_session(item,
|
||||||
args_get(args, 't'), args_has(args, 'D'),
|
newname, args_has(args, 'D'),
|
||||||
0, NULL, args_has(args, 'E')));
|
0, NULL, args_has(args, 'E')));
|
||||||
}
|
}
|
||||||
cmdq_error(item, "duplicate session: %s", newname);
|
cmdq_error(item, "duplicate session: %s", newname);
|
||||||
|
Loading…
Reference in New Issue
Block a user