From 16365f2014b5585a3a260e22c86c8197ffaf7285 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 17 Oct 2021 13:27:52 +0530 Subject: [PATCH] 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 --- docs/changelog.rst | 4 ++++ kitty/launch.py | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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: