From b28f620c9f53243e1a70a2b2bffbdfa8798f5c81 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 19 Aug 2025 21:58:25 +0530 Subject: [PATCH] Allow using save_as_session . to save to the path of the currently active session --- kitty/session.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kitty/session.py b/kitty/session.py index 4e5b2809d..f543084e1 100644 --- a/kitty/session.py +++ b/kitty/session.py @@ -483,7 +483,9 @@ def goto_session(boss: BossType, cmdline: Sequence[str]) -> None: save_as_session_message = '''\ Save the current state of kitty as a session file for easy re-use. If the path at which to save the session -file is not specified, kitty will prompt you for one.''' +file is not specified, kitty will prompt you for one. If the path is :code:`.` it will save the session +to the path of the currently active session, if there is one, otherwise prompt you for a path. +''' def save_as_session_options() -> str: @@ -546,6 +548,9 @@ def default_save_as_session_opts() -> SaveAsSessionOptions: def save_as_session(boss: BossType, cmdline: Sequence[str]) -> None: opts, args = parse_save_as_options_spec_args(list(cmdline)) path = args[0] if args else '' + if path == '.': + sn = boss.active_session + path = seen_session_paths.get(sn) or '' if path: save_as_session_part2(boss, opts, path) else: