From 49b065cbe76e89530ad9c04c06d9d2553a4dade1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 16 Jun 2018 10:22:46 +0530 Subject: [PATCH] Use conf_dir instead of cwd as base for session file --- kitty/config_data.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kitty/config_data.py b/kitty/config_data.py index 3d575b5f7..c8505f94b 100644 --- a/kitty/config_data.py +++ b/kitty/config_data.py @@ -11,7 +11,7 @@ from .conf.definition import option_func from .conf.utils import ( choices, positive_float, positive_int, to_cmdline, to_color, unit_float ) -from .constants import is_macos +from .constants import config_dir, is_macos from .fast_data_types import CURSOR_BEAM, CURSOR_BLOCK, CURSOR_UNDERLINE from .layout import all_layouts from .rgb import color_as_int, color_as_sharp, color_from_int @@ -622,15 +622,18 @@ def startup_session(x): if x.lower() == 'none': return x = os.path.expanduser(x) - return os.path.expandvars(x) + x = os.path.expandvars(x) + if not os.path.isabs(x): + x = os.path.join(config_dir, x) + return x o('startup_session', 'none', option_type=startup_session, long_text=_(''' Path to a session file to use for all kitty instances. Can be overridden by using the :option:`kitty --session` command line option for individual instances. See :ref:`sessions` in the kitty documentation for details. Note -that relative paths are interpreted with respect to the working directory -of the kitty process. Environment variables in the path are expanded. +that relative paths are interpreted with respect to the kitty config directory. +Environment variables in the path are expanded. ''')) o('clipboard_control', 'write-clipboard write-primary', option_type=lambda x: frozenset(x.lower().split()), long_text=_('''