version 1.67, 2015/06/04 23:27:51 |
version 1.68, 2015/06/07 21:39:39 |
|
|
|
|
const struct cmd_entry cmd_new_session_entry = { |
const struct cmd_entry cmd_new_session_entry = { |
"new-session", "new", |
"new-session", "new", |
"Ac:dDF:n:Ps:t:x:y:", 0, -1, |
"Ac:dDEF:n:Ps:t:x:y:", 0, -1, |
"[-AdDP] [-c start-directory] [-F format] [-n window-name] " |
"[-AdDEP] [-c start-directory] [-F format] [-n window-name] " |
"[-s session-name] " CMD_TARGET_SESSION_USAGE " [-x width] " |
"[-s session-name] " CMD_TARGET_SESSION_USAGE " [-x width] " |
"[-y height] [command]", |
"[-y height] [command]", |
CMD_STARTSERVER, |
CMD_STARTSERVER, |
|
|
if (session_find(newname) != NULL) { |
if (session_find(newname) != NULL) { |
if (args_has(args, 'A')) { |
if (args_has(args, 'A')) { |
return (cmd_attach_session(cmdq, newname, |
return (cmd_attach_session(cmdq, newname, |
args_has(args, 'D'), 0, NULL)); |
args_has(args, 'D'), 0, NULL, |
|
args_has(args, 'E'))); |
} |
} |
cmdq_error(cmdq, "duplicate session: %s", newname); |
cmdq_error(cmdq, "duplicate session: %s", newname); |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
|
|
|
|
/* Construct the environment. */ |
/* Construct the environment. */ |
environ_init(&env); |
environ_init(&env); |
update = options_get_string(&global_s_options, "update-environment"); |
if (c != NULL && !args_has(args, 'E')) { |
if (c != NULL) |
update = options_get_string(&global_s_options, |
|
"update-environment"); |
environ_update(update, &c->environ, &env); |
environ_update(update, &c->environ, &env); |
|
} |
|
|
/* Create the new session. */ |
/* Create the new session. */ |
idx = -1 - options_get_number(&global_s_options, "base-index"); |
idx = -1 - options_get_number(&global_s_options, "base-index"); |