When creating tabs via @ launch with the --match option create the tab in the OS Window containing the result of the match rather than the active OS Window

Fixes #4126
This commit is contained in:
Kovid Goyal
2021-10-17 13:27:52 +05:30
parent 0fa03da18c
commit 16365f2014
2 changed files with 8 additions and 1 deletions

View File

@@ -209,7 +209,10 @@ def get_env(opts: LaunchCLIOptions, active_child: Child) -> Dict[str, str]:
def tab_for_window(boss: Boss, opts: LaunchCLIOptions, target_tab: Optional[Tab] = None) -> Optional[Tab]:
if opts.type == 'tab':
tm = boss.active_tab_manager
if target_tab is not None:
tm = target_tab.tab_manager_ref() or boss.active_tab_manager
else:
tm = boss.active_tab_manager
if tm:
tab: Optional[Tab] = tm.new_tab(empty_tab=True, location=opts.location)
if opts.tab_title and tab is not None: