diff --git a/docs/changelog.rst b/docs/changelog.rst index c7803fae1..e36941add 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -79,6 +79,8 @@ Detailed list of changes - Fix a performance bottleneck when dealing with thousands of small images (:iss:`7080`) +- kitten @ ls: Return the timestamp at which the window was created (:iss:`7178`) + 0.32.2 [2024-02-12] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/window.py b/kitty/window.py index 991b56fc2..7f6c867b6 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -11,7 +11,7 @@ from enum import Enum, IntEnum, auto from functools import lru_cache, partial from gettext import gettext as _ from itertools import chain -from time import monotonic +from time import monotonic, time_ns from typing import ( TYPE_CHECKING, Any, @@ -230,6 +230,7 @@ class WindowDict(TypedDict): columns: int user_vars: Dict[str, str] at_prompt: bool + created_at: int class PipeData(TypedDict): @@ -541,6 +542,7 @@ class Window: self.is_focused: bool = False self.last_resized_at = 0. self.started_at = monotonic() + self.created_at = time_ns() self.current_remote_data: List[str] = [] self.current_mouse_event_button = 0 self.current_clipboard_read_ask: Optional[bool] = None @@ -683,6 +685,7 @@ class Window: 'lines': self.screen.lines, 'columns': self.screen.columns, 'user_vars': self.user_vars, + 'created_at': self.created_at, } def serialize_state(self) -> Dict[str, Any]: