add session save and session load functionality

New [key-bindings]:
- session-save: captures cwd and foreground process argv to ~/.local/share/foot/state/{name}.json
- session-save-secure: prompts for a password, encrypts the scrollback with argon2id + XChaCha20-Poly1305 (libsodium) and writes it to {name}.scrollback.enc(stores up to 1Mb scrollback buffer).
- session-load: a minimal fuzzy picker that displays saved sessions (both secure and vanilla), UI piggybacks on search bar subsurface. use arrows to navigate and delete to delete a previously saved session.
This commit is contained in:
entailz 2026-05-21 14:08:33 -07:00
parent 05ee680778
commit cabddb26e6
16 changed files with 1947 additions and 49 deletions

View file

@ -65,6 +65,11 @@ enum bind_action_normal {
BIND_ACTION_TAB_9,
BIND_ACTION_TAB_OVERVIEW,
/* Session actions */
BIND_ACTION_SESSION_SAVE,
BIND_ACTION_SESSION_LOAD,
BIND_ACTION_SESSION_SAVE_SECURE,
/* Mouse specific actions - i.e. they require a mouse coordinate */
BIND_ACTION_SCROLLBACK_UP_MOUSE,
BIND_ACTION_SCROLLBACK_DOWN_MOUSE,
@ -77,7 +82,7 @@ enum bind_action_normal {
BIND_ACTION_SELECT_QUOTE,
BIND_ACTION_SELECT_ROW,
BIND_ACTION_KEY_COUNT = BIND_ACTION_TAB_OVERVIEW + 1,
BIND_ACTION_KEY_COUNT = BIND_ACTION_SESSION_SAVE_SECURE + 1,
BIND_ACTION_COUNT = BIND_ACTION_SELECT_ROW + 1,
};