support search_syntax in focus_tab

This commit is contained in:
Jackie Li
2025-10-26 09:29:12 +00:00
parent e0bea0cac4
commit 75537187a8
3 changed files with 30 additions and 11 deletions

View File

@@ -159,6 +159,7 @@ all the major keywords you can use in kitty session files:
launch tail -f /var/log/syslog
# Focus the first tab (index 0) when the session loads
# You can also use a match expression like: focus_tab title:logs
focus_tab 0
# Create a complex layout using multiple splits. Creates two columns of
@@ -279,12 +280,14 @@ documentation for them.
otherwise the window manager might block changing focus to prevent *focus
stealing*.
``focus_tab [tab index]``
``focus_tab [tab specifier]``
Set which tab should be active (focused) in the current OS Window. The tab
index is 0-based, so ``focus_tab 0`` will focus the first tab, ``focus_tab 1``
the second tab, and so on. This is useful for session files that create
multiple tabs and want to ensure a specific tab is active when the session
is loaded.
specifier can be either a plain number (treated as a 0-based index) or a
match expression. For example, ``focus_tab 0`` will focus the first tab,
``focus_tab 1`` the second tab, and ``focus_tab title:logs`` will focus the
tab whose title matches "logs". See :ref:`search_syntax` for the full syntax
of match expressions. This is useful for session files that create multiple
tabs and want to ensure a specific tab is active when the session is loaded.
``enabled_layouts comma separated list of layout names``
Set the layouts allowed in the current tab. Same syntax as