Fix a regression that caused --title to not work when opening new OS windows using --single-instance

This commit is contained in:
Kovid Goyal 2021-08-17 20:31:11 +05:30
parent cd7b4fcd8e
commit 4066c2389d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 13 additions and 3 deletions

View File

@ -4,6 +4,12 @@ Changelog
|kitty| is a feature-rich, cross-platform, *fast*, GPU based terminal.
To update |kitty|, :doc:`follow the instructions <binary>`.
0.23.2 [future]
----------------------
- Fix a regression that caused :option:`kitty --title` to not work when
opening new OS windows using :option:`kitty --single-instance` (:iss:`3893`)
0.23.1 [2021-08-17]
----------------------

View File

@ -206,17 +206,19 @@ def add_os_window(
wclass: Optional[str] = None,
wname: Optional[str] = None,
opts_for_size: Optional[Options] = None,
startup_id: Optional[str] = None
startup_id: Optional[str] = None,
override_title: Optional[str] = None,
) -> int:
if os_window_id is None:
size_data = get_os_window_sizing_data(opts_for_size or get_options(), startup_session)
wclass = wclass or getattr(startup_session, 'os_window_class', None) or self.args.cls or appname
wname = wname or self.args.name or wclass
wtitle = override_title or self.args.title
with startup_notification_handler(do_notify=startup_id is not None, startup_id=startup_id) as pre_show_callback:
os_window_id = create_os_window(
initial_window_size_func(size_data, self.cached_values),
pre_show_callback,
self.args.title or appname, wname, wclass, disallow_override_title=bool(self.args.title))
wtitle or appname, wname, wclass, disallow_override_title=bool(wtitle))
else:
wname = self.args.name or self.args.cls or appname
wclass = self.args.cls or appname
@ -459,7 +461,9 @@ def peer_message_received(self, msg_bytes: bytes) -> Optional[bytes]:
if not os.path.isabs(args.directory):
args.directory = os.path.join(data['cwd'], args.directory)
for session in create_sessions(opts, args, respect_cwd=True):
os_window_id = self.add_os_window(session, wclass=args.cls, wname=args.name, opts_for_size=opts, startup_id=startup_id)
os_window_id = self.add_os_window(
session, wclass=args.cls, wname=args.name, opts_for_size=opts, startup_id=startup_id,
override_title=args.title or None)
if opts.background_opacity != get_options().background_opacity:
self._set_os_window_background_opacity(os_window_id, opts.background_opacity)
if data.get('notify_on_os_window_death'):