mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-07 17:43:53 +02:00
Expose window activity state in the kitty @ ls
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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]:
|
||||
|
||||
Reference in New Issue
Block a user