diff options
Diffstat (limited to 'cmd-new-window.c')
-rw-r--r-- | cmd-new-window.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/cmd-new-window.c b/cmd-new-window.c index 7f14b21a..c05a0ce8 100644 --- a/cmd-new-window.c +++ b/cmd-new-window.c @@ -49,7 +49,6 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq) struct args *args = self->args; struct session *s; struct winlink *wl; - struct client *c; const char *cmd, *path, *template; char **argv, *cause, *cp; int argc, idx, last, detached, cwd, fd = -1; @@ -109,11 +108,8 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq) if (args_has(args, 'c')) { ft = format_create(); - if ((c = cmd_find_client(cmdq, NULL, 1)) != NULL) - format_client(ft, c); - format_session(ft, s); - format_winlink(ft, s, s->curw); - format_window_pane(ft, s->curw->window->active); + format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, NULL, + NULL); cp = format_expand(ft, args_get(args, 'c')); format_free(ft); @@ -173,11 +169,8 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq) template = NEW_WINDOW_TEMPLATE; ft = format_create(); - if ((c = cmd_find_client(cmdq, NULL, 1)) != NULL) - format_client(ft, c); - format_session(ft, s); - format_winlink(ft, s, wl); - format_window_pane(ft, wl->window->active); + format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, wl, + NULL); cp = format_expand(ft, template); cmdq_print(cmdq, "%s", cp); |