version 1.101, 2017/02/09 15:04:53 |
version 1.102, 2017/03/08 13:36:12 |
|
|
char **argv, *cause, *cp; |
char **argv, *cause, *cp; |
int detached, already_attached, idx, argc; |
int detached, already_attached, idx, argc; |
u_int sx, sy; |
u_int sx, sy; |
struct format_tree *ft; |
|
struct environ_entry *envent; |
struct environ_entry *envent; |
struct cmd_find_state fs; |
struct cmd_find_state fs; |
|
|
|
|
|
|
/* Get the new session working directory. */ |
/* Get the new session working directory. */ |
if (args_has(args, 'c')) { |
if (args_has(args, 'c')) { |
ft = format_create(item, FORMAT_NONE, 0); |
cwd = args_get(args, 'c'); |
format_defaults(ft, c, NULL, NULL, NULL); |
to_free = cwd = format_single(item, cwd, c, NULL, NULL, NULL); |
to_free = cwd = format_expand(ft, args_get(args, 'c')); |
|
format_free(ft); |
|
} else if (c != NULL && c->session == NULL && c->cwd != NULL) |
} else if (c != NULL && c->session == NULL && c->cwd != NULL) |
cwd = c->cwd; |
cwd = c->cwd; |
else |
else |
|
|
if (args_has(args, 'P')) { |
if (args_has(args, 'P')) { |
if ((template = args_get(args, 'F')) == NULL) |
if ((template = args_get(args, 'F')) == NULL) |
template = NEW_SESSION_TEMPLATE; |
template = NEW_SESSION_TEMPLATE; |
|
cp = format_single(item, template, c, s, NULL, NULL); |
ft = format_create(item, FORMAT_NONE, 0); |
|
format_defaults(ft, c, s, NULL, NULL); |
|
|
|
cp = format_expand(ft, template); |
|
cmdq_print(item, "%s", cp); |
cmdq_print(item, "%s", cp); |
free(cp); |
free(cp); |
|
|
format_free(ft); |
|
} |
} |
|
|
if (!detached) |
if (!detached) |