Add an option to set the window title

Fixes #201
This commit is contained in:
Kovid Goyal
2017-11-30 16:42:55 +05:30
parent cada4a8ca8
commit a0702f4a97
3 changed files with 13 additions and 2 deletions

View File

@@ -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]
---------------------------

View File

@@ -25,6 +25,11 @@ condition=not is_macos
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 @@ The window layout to use on startup. Choices are: {window_layout_choices}
--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

View File

@@ -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