Ignore startup_session when kitty is invoked with command line options specifying a command to run

This commit is contained in:
Kovid Goyal
2024-03-10 09:41:08 +05:30
parent fccf8db099
commit 88b7595929
3 changed files with 4 additions and 3 deletions

View File

@@ -90,6 +90,7 @@ Detailed list of changes
- Keyboard protocol: Do not deliver a fake key release events on OS window focus out for engaged modifiers (:iss:`7196`)
- Ignore :opt:`startup_session` when kitty is invoked with command line options specifying a command to run (:pull:`7198`)
0.32.2 [2024-02-12]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -3057,8 +3057,8 @@ using the :option:`kitty --session` :code:`=none` command line option for indivi
instances. See :ref:`sessions` in the kitty documentation for details. Note that
relative paths are interpreted with respect to the kitty config directory.
Environment variables in the path are expanded. Changing this option by
reloading the config is not supported. Note that this prevents kitty from processing
any command line arguments as a program to run.
reloading the config is not supported. Note that if kitty is invoked with command line
arguments specifying a command to run, this option is ignored.
'''
)

View File

@@ -222,7 +222,7 @@ def create_sessions(
session_data = f.read()
yield from parse_session(session_data, opts, environ=environ)
return
if default_session and default_session != 'none':
if default_session and default_session != 'none' and not getattr(args, 'args', None):
try:
with open(default_session) as f:
session_data = f.read()