From a0702f4a9763b23dc32200e2336586ee23b7fa64 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 30 Nov 2017 16:42:55 +0530 Subject: [PATCH] Add an option to set the window title Fixes #201 --- CHANGELOG.rst | 1 + kitty/cli.py | 8 +++++++- kitty/session.py | 6 +++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 190348ef6..ae4330bf5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -29,6 +29,7 @@ version 0.6.0 [future] - Add a command line switch to set the name part of the WM_CLASS window property independently. +- Add a command line switch to set the window title. version 0.5.1 [2017-12-01] --------------------------- diff --git a/kitty/cli.py b/kitty/cli.py index 9f4bec2bb..ac2651fe3 100644 --- a/kitty/cli.py +++ b/kitty/cli.py @@ -25,6 +25,11 @@ Set the name part of the |_ WM_CLASS| property (defaults to using the value from |_ --class|) +--title +Set the 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. + + --config type=list default={config_path} @@ -61,7 +66,8 @@ --session -Path to a file containing the startup |_ session| (tabs, windows, layout, programs) +Path to a file containing the startup |_ session| (tabs, windows, layout, programs). +See the README file for details and an example. --single-instance -1 diff --git a/kitty/session.py b/kitty/session.py index aa8249a93..118eeb909 100644 --- a/kitty/session.py +++ b/kitty/session.py @@ -100,7 +100,11 @@ def create_session(opts, args=None, special_window=None): ans.tabs[-1].layout = current_layout if special_window is None: cmd = args.args if args and args.args else [shell_path] - ans.add_window(cmd) + if args.title: + from kitty.tabs import SpecialWindow + ans.add_window(SpecialWindow(cmd, override_title=args.title)) + else: + ans.add_window(cmd) else: ans.add_special_window(special_window) return ans