From f711e55a224b99a3cd5e6287555743d5cb241098 Mon Sep 17 00:00:00 2001 From: Bartek Mucha Date: Mon, 13 Apr 2026 14:29:56 +0100 Subject: [PATCH 1/2] Expose window activity state in the kitty @ ls --- kitty/tabs.py | 4 ++++ kitty/window.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/kitty/tabs.py b/kitty/tabs.py index a1026681f..618631cbc 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -129,6 +129,8 @@ class TabDict(TypedDict): is_active: bool title: str title_overridden: bool + needs_attention: bool + has_activity_since_last_focus: bool layout: str layout_state: dict[str, Any] layout_opts: dict[str, Any] @@ -1444,6 +1446,8 @@ class TabManager: # {{{ 'is_active': tab is active_tab, 'title': tab.name or tab.title, 'title_overridden': bool(tab.name), + 'needs_attention': any(w.needs_attention for w in tab), + 'has_activity_since_last_focus': any(w.has_activity_since_last_focus for w in tab), 'layout': str(tab.current_layout.name), 'layout_state': tab.current_layout.serialize(tab.windows), 'layout_opts': tab.current_layout.layout_opts.serialized(), diff --git a/kitty/window.py b/kitty/window.py index fa0b27343..e2e4a41a2 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -271,6 +271,8 @@ class WindowDict(TypedDict): in_alternate_screen: bool neighbors: NeighborsMap session_name: str + needs_attention: bool + has_activity_since_last_focus: bool class PipeData(TypedDict): @@ -2160,6 +2162,8 @@ class Window: 'in_alternate_screen': self.screen.is_using_alternate_linebuf(), 'neighbors': neighbors_map, 'session_name': self.created_in_session_name, + 'needs_attention': self.needs_attention, + 'has_activity_since_last_focus': self.has_activity_since_last_focus, } def serialize_state(self) -> dict[str, Any]: From 0aa5d32f5f0169e910605b3f547ce0d1574a9636 Mon Sep 17 00:00:00 2001 From: Bartek Mucha Date: Wed, 15 Apr 2026 12:59:04 +0100 Subject: [PATCH 2/2] Don't replicate data on tabs --- kitty/tabs.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/kitty/tabs.py b/kitty/tabs.py index 618631cbc..a1026681f 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -129,8 +129,6 @@ class TabDict(TypedDict): is_active: bool title: str title_overridden: bool - needs_attention: bool - has_activity_since_last_focus: bool layout: str layout_state: dict[str, Any] layout_opts: dict[str, Any] @@ -1446,8 +1444,6 @@ class TabManager: # {{{ 'is_active': tab is active_tab, 'title': tab.name or tab.title, 'title_overridden': bool(tab.name), - 'needs_attention': any(w.needs_attention for w in tab), - 'has_activity_since_last_focus': any(w.has_activity_since_last_focus for w in tab), 'layout': str(tab.current_layout.name), 'layout_state': tab.current_layout.serialize(tab.windows), 'layout_opts': tab.current_layout.layout_opts.serialized(),