diff --git a/docs/changelog.rst b/docs/changelog.rst index 482edf874..ad989fff2 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -95,6 +95,10 @@ To update |kitty|, :doc:`follow the instructions `. - Fix the :program:`resize OS Windows ` setting a slightly incorrect size on high DPI screens (:iss:`4114`) +- :program:`kitty @ launch` - when creating tabs with the ``--match`` option create + the tab in the OS Window containing the result of the match rather than + the active OS Window (:iss:`4126`) + 0.23.1 [2021-08-17] ---------------------- diff --git a/kitty/launch.py b/kitty/launch.py index f6ced4f8d..8ab1baeef 100644 --- a/kitty/launch.py +++ b/kitty/launch.py @@ -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: