Allow using relative paths in cd in sessions files that get resolved relative to the directory containing the session file

This commit is contained in:
Kovid Goyal
2025-08-17 11:23:36 +05:30
parent 117f6cc4fa
commit 67b2e859f5
5 changed files with 42 additions and 9 deletions

View File

@@ -546,7 +546,7 @@ def kitty_main(called_from_panel: bool = False) -> None:
if cli_opts.detach:
if cli_opts.session == '-':
from .session import PreReadSession
cli_opts.session = PreReadSession(sys.stdin.read(), os.environ, '-')
cli_opts.session = PreReadSession(sys.stdin.read(), os.environ, '-', os.path.join(os.getcwd(), '-'))
if cli_opts.replay_commands:
from kitty.client import main as client_main
client_main(cli_opts.replay_commands)