From 938ad5a98c2a37938ea726a910e640a2a8aa8d26 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 3 Apr 2020 13:54:31 +0000 Subject: [PATCH] Use new window and new pane as well for -P to new-session or new-window. --- cmd-new-session.c | 2 +- cmd-new-window.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd-new-session.c b/cmd-new-session.c index c76b564e..a75fc972 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -334,7 +334,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) if (args_has(args, 'P')) { if ((template = args_get(args, 'F')) == NULL) template = NEW_SESSION_TEMPLATE; - cp = format_single(item, template, c, s, NULL, NULL); + cp = format_single(item, template, c, s, s->curw, NULL); cmdq_print(item, "%s", cp); free(cp); } diff --git a/cmd-new-window.c b/cmd-new-window.c index 9a1025e9..2fb92830 100644 --- a/cmd-new-window.c +++ b/cmd-new-window.c @@ -108,7 +108,8 @@ 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; - cp = format_single(item, template, c, s, new_wl, NULL); + cp = format_single(item, template, c, s, new_wl, + new_wl->window->active); cmdq_print(item, "%s", cp); free(cp); }