Use conf_dir instead of cwd as base for session file

This commit is contained in:
Kovid Goyal
2018-06-16 10:22:46 +05:30
parent 77f651cb5d
commit 49b065cbe7

View File

@@ -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=_('''