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

12
input.c
View file

@ -491,6 +491,18 @@ static bool execute_binding(struct seat *seat, struct terminal *term,
tab_overview_toggle(term->window);
return true;
case BIND_ACTION_SESSION_SAVE:
search_begin_session(term, SEARCH_MODE_SESSION_SAVE);
return true;
case BIND_ACTION_SESSION_LOAD:
search_begin_session(term, SEARCH_MODE_SESSION_LOAD);
return true;
case BIND_ACTION_SESSION_SAVE_SECURE:
search_begin_session(term, SEARCH_MODE_SESSION_SAVE_SECURE_NAME);
return true;
case BIND_ACTION_REGEX_LAUNCH:
case BIND_ACTION_REGEX_COPY:
if (binding->aux->type != BINDING_AUX_REGEX)