diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2017-03-09 15:39:36 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2017-03-09 15:39:36 +0000 |
commit | 180ebf02081087eec625a25c785985f5d6b5eff4 (patch) | |
tree | 7d995692ed6007c747da0caa2b189aadfac91917 /cmd-new-window.c | |
parent | 514a723f7489123371bded176355ead48f338ae0 (diff) | |
parent | 92434b0afdf9cf04f1067c4e782b3132002b267a (diff) | |
download | rtmux-180ebf02081087eec625a25c785985f5d6b5eff4.tar.gz rtmux-180ebf02081087eec625a25c785985f5d6b5eff4.tar.bz2 rtmux-180ebf02081087eec625a25c785985f5d6b5eff4.zip |
Merge branch 'master' of github.com:tmux/tmux
Diffstat (limited to 'cmd-new-window.c')
-rw-r--r-- | cmd-new-window.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/cmd-new-window.c b/cmd-new-window.c index 082b7443..c10a4aaf 100644 --- a/cmd-new-window.c +++ b/cmd-new-window.c @@ -59,7 +59,6 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item) const char *cmd, *path, *template, *cwd, *to_free; char **argv, *cause, *cp; int argc, detached; - struct format_tree *ft; struct environ_entry *envent; struct cmd_find_state fs; @@ -95,10 +94,8 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item) to_free = NULL; if (args_has(args, 'c')) { - ft = format_create(item, FORMAT_NONE, 0); - format_defaults(ft, c, s, NULL, NULL); - cwd = to_free = format_expand(ft, args_get(args, 'c')); - format_free(ft); + cwd = args_get(args, 'c'); + to_free = cwd = format_single(item, cwd, c, s, NULL, NULL); } else if (item->client != NULL && item->client->session == NULL) cwd = item->client->cwd; else @@ -142,15 +139,9 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item) if (args_has(args, 'P')) { if ((template = args_get(args, 'F')) == NULL) template = NEW_WINDOW_TEMPLATE; - - ft = format_create(item, FORMAT_NONE, 0); - format_defaults(ft, c, s, wl, NULL); - - cp = format_expand(ft, template); + cp = format_single(item, template, c, s, wl, NULL); cmdq_print(item, "%s", cp); free(cp); - - format_free(ft); } if (to_free != NULL) |