diff --git a/docs/changelog.rst b/docs/changelog.rst index 0d8c12125..592968f57 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -11,7 +11,9 @@ To update |kitty|, :doc:`follow the instructions `. tabbed file, see :opt:`tab_bar_style` - Fix :option:`kitty --title` not overriding the OS Window title when multiple - tabs are present (:iss:`3893`) + tabs are present. Also this option is no longer used as the default title for + windows, allowing individual tabs/windows to have their own titles, even when + the OS Window has a fixed overall title (:iss:`3893`) 0.22.2 [2021-08-02] diff --git a/kitty/cli.py b/kitty/cli.py index c750d1fb9..c48bf1caf 100644 --- a/kitty/cli.py +++ b/kitty/cli.py @@ -596,10 +596,8 @@ Set the name part of the :italic:`WM_CLASS` property (defaults to using the valu --title -T -Set the OS window title. This will override any title set by the program running inside kitty. So -only use this if you are running a program that does not set titles. If combined -with :option:`{appname} --session` the title will be used for all windows created by the -session, that do not set their own titles. +Set the OS window title. This will override any title set by the program running inside kitty, permanently +fixing the OS Window's title. So only use this if you are running a program that does not set titles. --config -c diff --git a/kitty/session.py b/kitty/session.py index d6c5013f0..188bcc1a3 100644 --- a/kitty/session.py +++ b/kitty/session.py @@ -90,16 +90,16 @@ class Session: self.tabs[-1].cwd = val -def parse_session(raw: str, opts: Options, default_title: Optional[str] = None) -> Generator[Session, None, None]: +def parse_session(raw: str, opts: Options) -> Generator[Session, None, None]: def finalize_session(ans: Session) -> Session: from .tabs import SpecialWindow for t in ans.tabs: if not t.windows: - t.windows.append(SpecialWindow(cmd=resolved_shell(opts), override_title=default_title)) + t.windows.append(SpecialWindow(cmd=resolved_shell(opts))) return ans - ans = Session(default_title) + ans = Session() ans.add_tab(opts) for line in raw.splitlines(): line = line.strip() @@ -114,7 +114,7 @@ def parse_session(raw: str, opts: Options, default_title: Optional[str] = None) ans.add_tab(opts, rest) elif cmd == 'new_os_window': yield finalize_session(ans) - ans = Session(default_title) + ans = Session() ans.add_tab(opts, rest) elif cmd == 'layout': ans.set_layout(rest) @@ -164,7 +164,7 @@ def create_sessions( f = open(args.session) with f: session_data = f.read() - yield from parse_session(session_data, opts, getattr(args, 'title', None)) + yield from parse_session(session_data, opts) return if default_session and default_session != 'none': try: @@ -173,7 +173,7 @@ def create_sessions( except OSError: log_error('Failed to read from session file, ignoring: {}'.format(default_session)) else: - yield from parse_session(session_data, opts, getattr(args, 'title', None)) + yield from parse_session(session_data, opts) return default_watchers = args.watcher if args else () ans = Session(default_watchers=default_watchers) @@ -186,7 +186,6 @@ def create_sessions( cmd = [kitty_exe(), '+hold'] + cmd from kitty.tabs import SpecialWindow cwd: Optional[str] = args.directory if respect_cwd and args else None - title = getattr(args, 'title', None) - special_window = SpecialWindow(cmd, override_title=title, cwd_from=cwd_from, cwd=cwd) + special_window = SpecialWindow(cmd, cwd_from=cwd_from, cwd=cwd) ans.add_special_window(special_window) yield ans