From 88b7595929b31e293a2fb0ddc91305679dfd4182 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 10 Mar 2024 09:41:08 +0530 Subject: [PATCH] Ignore startup_session when kitty is invoked with command line options specifying a command to run --- docs/changelog.rst | 1 + kitty/options/definition.py | 4 ++-- kitty/session.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 394321db8..8994eb8ea 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/options/definition.py b/kitty/options/definition.py index 5a792bb02..26f0daed1 100644 --- a/kitty/options/definition.py +++ b/kitty/options/definition.py @@ -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. ''' ) diff --git a/kitty/session.py b/kitty/session.py index bf1d9efbf..3f9866f0f 100644 --- a/kitty/session.py +++ b/kitty/session.py @@ -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()