feat(session): restore the last session from a keybinding

Besides the --session=last startup option, the saved state can now be brought
back in a running kitty with restore_last_session, mapped to kitty_mod+alt+r.
The option types are regenerated so the shortcut is actually part of the
default configuration.
This commit is contained in:
BlackAngelTV committed 2026-11-11 21:39:45 +01:00
1 parent d7eca9efbb
commit dbcb364526
7 files changed
+62 -1

No files matched your search

+7
View File
@@ -3959,6 +3959,13 @@ class Boss:
def goto_session(self, *cmdline: str) -> None:
goto_session(self, cmdline)
@ac('session', 'Restore the tabs and windows of the session saved when kitty last quit. See :ref:`sessions`.')
def restore_last_session(self) -> None:
from .session_restore import restore_last_session_into
if not restore_last_session_into(self):
self.ring_bell_if_allowed()
@ac('session', 'Save the current kitty state as a session file. See :ref:`save_as_session`.')
def save_as_session(self, *cmdline: str) -> None:
save_as_session(self, cmdline)