mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Use new window and new pane as well for -P to new-session or new-window.
This commit is contained in:
		@@ -334,7 +334,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
	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);
 | 
							cp = format_single(item, template, c, s, s->curw, NULL);
 | 
				
			||||||
		cmdq_print(item, "%s", cp);
 | 
							cmdq_print(item, "%s", cp);
 | 
				
			||||||
		free(cp);
 | 
							free(cp);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -108,7 +108,8 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
	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_WINDOW_TEMPLATE;
 | 
								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);
 | 
							cmdq_print(item, "%s", cp);
 | 
				
			||||||
		free(cp);
 | 
							free(cp);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user