diff --git a/docs/sessions.rst b/docs/sessions.rst index 892dcdb77..2b7f0a6b2 100644 --- a/docs/sessions.rst +++ b/docs/sessions.rst @@ -135,6 +135,8 @@ all the major keywords you can use in kitty session files: new_os_window # Set new window size to 80x24 cells os_window_size 80c 24c + # Set the --title for the new OS window + os_window_title my fancy os window # Set the --class for the new OS window os_window_class mywindow # Set the --name for the new OS window @@ -291,6 +293,11 @@ documentation for them. Create a new tab with the specified title. If no title is specified, the title behaves just as for a regular tab in kitty. +``os_window_title`` + Set the title for the current OS Window. The OS Window will then always + have this title, it will not change based on the title of the currently active + window inside the OS Window. + ``os_window_class`` Set the class part of WM_CLASS or Wayland Application Id for the current OS Window diff --git a/kitty/boss.py b/kitty/boss.py index 386bbda23..7dee3ecf9 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -456,7 +456,7 @@ class Boss: 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 getattr(startup_session, 'os_window_name', None) or self.args.name or wclass - wtitle = override_title or self.args.title + wtitle = override_title or getattr(startup_session, 'os_window_title', None) or self.args.title window_state = window_state or getattr(startup_session, 'os_window_state', None) wstate = parse_os_window_state(window_state) if window_state is not None else None with startup_notification_handler(do_notify=startup_id is not None, startup_id=startup_id) as pre_show_callback: diff --git a/kitty/session.py b/kitty/session.py index 096d908b3..e247a28b5 100644 --- a/kitty/session.py +++ b/kitty/session.py @@ -92,6 +92,7 @@ class Session: self.os_window_class: str | None = None self.os_window_name: str | None = None self.os_window_state: str | None = None + self.os_window_title: str | None = None self.focus_os_window: bool = False @property @@ -263,6 +264,8 @@ def parse_session( ans.os_window_class = rest elif cmd == 'os_window_name': ans.os_window_name = rest + elif cmd == 'os_window_title': + ans.os_window_title = rest elif cmd == 'os_window_state': ans.os_window_state = rest elif cmd == 'resize_window': @@ -339,6 +342,7 @@ def create_sessions( if args is not None: ans.os_window_class = args.cls ans.os_window_name = args.name + ans.os_window_title = args.title if special_window is None: cmd = args.args if args and args.args else resolved_shell(opts) from kitty.tabs import SpecialWindow