mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 18:22:09 +02:00
Merge upstream/master into feat-draggable-window-title-bars
Resolves conflict in kitty/tabs.py by keeping both force_show_title_bars and renaming_in_window fields.
This commit is contained in:
@@ -238,6 +238,7 @@ class WindowDict(TypedDict):
|
||||
is_focused: bool
|
||||
is_active: bool
|
||||
title: str
|
||||
title_overridden: bool
|
||||
pid: int | None
|
||||
cwd: str
|
||||
cmdline: list[str]
|
||||
@@ -305,6 +306,7 @@ class Watchers:
|
||||
on_cmd_startstop: list[Watcher]
|
||||
on_color_scheme_preference_change: list[Watcher]
|
||||
on_tab_bar_dirty: list[Watcher]
|
||||
on_quit: list[Watcher]
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.on_resize = []
|
||||
@@ -315,6 +317,7 @@ class Watchers:
|
||||
self.on_cmd_startstop = []
|
||||
self.on_color_scheme_preference_change = []
|
||||
self.on_tab_bar_dirty = []
|
||||
self.on_quit = []
|
||||
|
||||
def add(self, others: 'Watchers') -> None:
|
||||
def merge(base: list[Watcher], other: list[Watcher]) -> None:
|
||||
@@ -329,12 +332,14 @@ class Watchers:
|
||||
merge(self.on_cmd_startstop, others.on_cmd_startstop)
|
||||
merge(self.on_color_scheme_preference_change, others.on_color_scheme_preference_change)
|
||||
merge(self.on_tab_bar_dirty, others.on_tab_bar_dirty)
|
||||
merge(self.on_quit, others.on_quit)
|
||||
|
||||
def clear(self) -> None:
|
||||
del self.on_close[:], self.on_resize[:], self.on_focus_change[:]
|
||||
del self.on_set_user_var[:], self.on_title_change[:], self.on_cmd_startstop[:]
|
||||
del self.on_color_scheme_preference_change[:]
|
||||
del self.on_tab_bar_dirty[:]
|
||||
del self.on_quit[:]
|
||||
|
||||
def copy(self) -> 'Watchers':
|
||||
ans = Watchers()
|
||||
@@ -346,12 +351,14 @@ class Watchers:
|
||||
ans.on_cmd_startstop = self.on_cmd_startstop[:]
|
||||
ans.on_color_scheme_preference_change = self.on_color_scheme_preference_change[:]
|
||||
ans.on_tab_bar_dirty = self.on_tab_bar_dirty[:]
|
||||
ans.on_quit = self.on_quit[:]
|
||||
return ans
|
||||
|
||||
@property
|
||||
def has_watchers(self) -> bool:
|
||||
return bool(self.on_close or self.on_resize or self.on_focus_change or self.on_color_scheme_preference_change
|
||||
or self.on_set_user_var or self.on_title_change or self.on_cmd_startstop or self.on_tab_bar_dirty)
|
||||
or self.on_set_user_var or self.on_title_change or self.on_cmd_startstop or self.on_tab_bar_dirty
|
||||
or self.on_quit)
|
||||
|
||||
|
||||
def call_watchers(windowref: Callable[[], Optional['Window']], which: str, data: dict[str, Any]) -> None:
|
||||
@@ -1252,7 +1259,7 @@ class Window:
|
||||
try:
|
||||
parts = tuple(map(int, raw_data.split(';')))[1:]
|
||||
except Exception:
|
||||
log_error(f'Ignoring malmormed OSC 9;4 progress report: {raw_data!r}')
|
||||
log_error(f'Ignoring malformed OSC 9;4 progress report: {raw_data!r}')
|
||||
return
|
||||
self.progress.update(*parts[:2])
|
||||
if (tab := self.tabref()) is not None:
|
||||
@@ -2019,7 +2026,7 @@ class Window:
|
||||
def handle_dangerous_paste_confirmation(self, unsanitized: bytes, sanitized: bytes, choice: str) -> None:
|
||||
if choice == 's':
|
||||
self.paste_text(sanitized)
|
||||
elif choice == 'p':
|
||||
elif choice == 'a':
|
||||
self.paste_text(unsanitized)
|
||||
|
||||
def handle_large_paste_confirmation(self, btext: bytes, confirmed: bool) -> None:
|
||||
@@ -2083,6 +2090,7 @@ class Window:
|
||||
'is_focused': is_focused,
|
||||
'is_active': is_active,
|
||||
'title': self.title,
|
||||
'title_overridden': self.override_title is not None,
|
||||
'pid': self.child.pid,
|
||||
'cwd': self.child.current_cwd or self.child.cwd,
|
||||
'cmdline': self.child.cmdline,
|
||||
|
||||
Reference in New Issue
Block a user