=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-new-session.c,v retrieving revision 1.125 retrieving revision 1.126 diff -c -r1.125 -r1.126 *** src/usr.bin/tmux/cmd-new-session.c 2020/04/13 08:26:27 1.125 --- src/usr.bin/tmux/cmd-new-session.c 2020/04/13 10:59:58 1.126 *************** *** 1,4 **** ! /* $OpenBSD: cmd-new-session.c,v 1.125 2020/04/13 08:26:27 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-new-session.c,v 1.126 2020/04/13 10:59:58 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 67,73 **** cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); ! struct client *c = item->client; struct session *s, *as, *groupwith; struct environ *env; struct options *oo; --- 67,76 ---- cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); ! struct cmdq_shared *shared = cmdq_get_shared(item); ! struct cmd_find_state *current = &shared->current; ! struct cmd_find_state *target = cmdq_get_target(item); ! struct client *c = cmdq_get_client(item); struct session *s, *as, *groupwith; struct environ *env; struct options *oo; *************** *** 106,112 **** if (newname != NULL) as = session_find(newname); else ! as = item->target.s; if (as != NULL) { retval = cmd_attach_session(item, as->name, args_has(args, 'D'), args_has(args, 'X'), 0, NULL, --- 109,115 ---- if (newname != NULL) as = session_find(newname); else ! as = target->s; if (as != NULL) { retval = cmd_attach_session(item, as->name, args_has(args, 'D'), args_has(args, 'X'), 0, NULL, *************** *** 123,129 **** /* Is this going to be part of a session group? */ group = args_get(args, 't'); if (group != NULL) { ! groupwith = item->target.s; if (groupwith == NULL) { if (!session_check_name(group)) { cmdq_error(item, "bad group name: %s", group); --- 126,132 ---- /* Is this going to be part of a session group? */ group = args_get(args, 't'); if (group != NULL) { ! groupwith = target->s; if (groupwith == NULL) { if (!session_check_name(group)) { cmdq_error(item, "bad group name: %s", group); *************** *** 172,178 **** * over. */ if (!detached && !already_attached && c->tty.fd != -1) { ! if (server_client_check_nested(item->client)) { cmdq_error(item, "sessions should be nested with care, " "unset $TMUX to force"); goto fail; --- 175,181 ---- * over. */ if (!detached && !already_attached && c->tty.fd != -1) { ! if (server_client_check_nested(cmdq_get_client(item))) { cmdq_error(item, "sessions should be nested with care, " "unset $TMUX to force"); goto fail; *************** *** 314,320 **** } else if (c->session != NULL) c->last_session = c->session; c->session = s; ! if (~item->shared->flags & CMDQ_SHARED_REPEAT) server_client_set_key_table(c, NULL); tty_update_client_offset(c); status_timer_start(c); --- 317,323 ---- } else if (c->session != NULL) c->last_session = c->session; c->session = s; ! if (~shared->flags & CMDQ_SHARED_REPEAT) server_client_set_key_table(c, NULL); tty_update_client_offset(c); status_timer_start(c); *************** *** 344,350 **** if (!detached) { c->flags |= CLIENT_ATTACHED; ! cmd_find_from_session(&item->shared->current, s, 0); } cmd_find_from_session(&fs, s, 0); --- 347,353 ---- if (!detached) { c->flags |= CLIENT_ATTACHED; ! cmd_find_from_session(current, s, 0); } cmd_find_from_session(&fs, s, 0);