Repository navigation
Idea: user-defined save/restore hooks for application-specific state #10828
Replies: 3 comments
|
You should be able to build this using the existing hooks provided by
watchers, et al. If something is missing let me know.
|
|
Following up on "if something is missing let me know": I built a session saver on watchers (each session saved
I can send a PR for either if they would be welcome. |
|
Sure, done in master
|
Uh oh!
There was an error while loading. Please reload this page.
Would a reusable way for user extensions to save and restore application-specific state be useful in kitty? I'd like to ask about the direction before proposing an API or doing further implementation.
With 0.50's logout restoration, kitty can restore the terminal layout and scrollback. Some workflows also need a resume action derived from runtime state, such as continuing a specific CLI conversation. I have seen
save_as_session --use-foreground-processand the ssh kitten's session support; a separate resume identifier is the case I am interested in.The broad idea is user-defined save/restore handlers: a save handler returns application-specific data, kitty persists it alongside the terminal state, and restoration invokes the corresponding handler with that data. The user implementation defines what the state means and how much to restore. Existing applications would not need to change. I am not proposing a particular API, implementation language, or registration scheme at this stage.
My local experience on macOS:
I saw the watcher-based approach discussed in #9675 and #9927. Does this seem useful as a general extension pattern? Would you recommend building entirely on the existing watcher/session mechanisms, or is there a small missing extension point worth discussing?
All reactions