mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-18 06:25:13 +02:00
Allow setting WM_CLASS and WM_NAME when creating new OS windows with the launch command
This commit is contained in:
@@ -57,6 +57,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
|||||||
- Fix incorrect rendering of selection when using rectangular select and
|
- Fix incorrect rendering of selection when using rectangular select and
|
||||||
scrolling (:iss:`2351`)
|
scrolling (:iss:`2351`)
|
||||||
|
|
||||||
|
- Allow setting WM_CLASS and WM_NAME when creating new OS windows with the
|
||||||
|
launch command (:option:`launch --os-window-class`)
|
||||||
|
|
||||||
- macOS: When switching input method while a pending multi-key input is in
|
- macOS: When switching input method while a pending multi-key input is in
|
||||||
progress, clear the pending input (:iss:`2358`)
|
progress, clear the pending input (:iss:`2358`)
|
||||||
|
|
||||||
|
|||||||
@@ -198,12 +198,12 @@ class Boss:
|
|||||||
) -> int:
|
) -> int:
|
||||||
if os_window_id is None:
|
if os_window_id is None:
|
||||||
opts_for_size = opts_for_size or getattr(startup_session, 'os_window_size', None) or self.opts
|
opts_for_size = opts_for_size or getattr(startup_session, 'os_window_size', None) or self.opts
|
||||||
cls = wclass or self.args.cls or appname
|
wclass = wclass or self.args.cls or appname
|
||||||
with startup_notification_handler(do_notify=startup_id is not None, startup_id=startup_id) as pre_show_callback:
|
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(
|
os_window_id = create_os_window(
|
||||||
initial_window_size_func(opts_for_size, self.cached_values),
|
initial_window_size_func(opts_for_size, self.cached_values),
|
||||||
pre_show_callback,
|
pre_show_callback,
|
||||||
appname, wname or self.args.name or cls, cls)
|
appname, wname or self.args.name or wclass, wclass)
|
||||||
tm = TabManager(os_window_id, self.opts, self.args, startup_session)
|
tm = TabManager(os_window_id, self.opts, self.args, startup_session)
|
||||||
self.os_window_map[os_window_id] = tm
|
self.os_window_map[os_window_id] = tm
|
||||||
return os_window_id
|
return os_window_id
|
||||||
|
|||||||
@@ -136,6 +136,18 @@ screen.
|
|||||||
--marker
|
--marker
|
||||||
Create a marker that highlights text in the newly created window. The syntax is
|
Create a marker that highlights text in the newly created window. The syntax is
|
||||||
the same as for the :code:`toggle_marker` map action (see :doc:`/marks`).
|
the same as for the :code:`toggle_marker` map action (see :doc:`/marks`).
|
||||||
|
|
||||||
|
|
||||||
|
--os-window-class
|
||||||
|
Set the WM_CLASS property on X11 and the application id property on Wayland for
|
||||||
|
the newly created OS Window when using :option:`launch --type`=os-window.
|
||||||
|
Defaults to whatever is used by the parent kitty process, which in turn
|
||||||
|
defaults to :code:`kitty`.
|
||||||
|
|
||||||
|
|
||||||
|
--os-window-name
|
||||||
|
Set the WM_NAME property on X11 for the newly created OS Window when using
|
||||||
|
:option:`launch --type`=os-window. Defaults to :option:`launch --os-window-class`.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
@@ -169,7 +181,7 @@ def tab_for_window(boss: Boss, opts: LaunchCLIOptions, target_tab: Optional[Tab]
|
|||||||
else:
|
else:
|
||||||
tab = None
|
tab = None
|
||||||
elif opts.type == 'os-window':
|
elif opts.type == 'os-window':
|
||||||
oswid = boss.add_os_window()
|
oswid = boss.add_os_window(wclass=opts.os_window_class, wname=opts.os_window_name)
|
||||||
tm = boss.os_window_map[oswid]
|
tm = boss.os_window_map[oswid]
|
||||||
tab = tm.new_tab(empty_tab=True)
|
tab = tm.new_tab(empty_tab=True)
|
||||||
if opts.tab_title:
|
if opts.tab_title:
|
||||||
|
|||||||
Reference in New Issue
Block a user