Support saving and restoring of terminal state
See original GitHub issueHi everyone,
With xterm.js
maturing, I think a great feature to expand the range of applications xterm.js
could be useful for would be the formalization of a headless mode. What do I mean? Well basically, for the ability to:
- Run a client without a renderer.
- Communicate to a client with a renderer the state of a headless client and vice versa.
Right now, the only way to reliably “set” the state of a client is to replay the set of all commands that produced that editor’s state (at least via the public API). However, you could easily imagine wanting to do things like:
- scrubbing back and forth through a terminal’s history
- running a terminal in the cloud that you intermittently connect to via the client
- (my use case) having multiple users have literally the same terminal with the ability to come and go
A lot of this is basically almost already possible if you just serialize term.rows
and assorted state flags, but the adoption of a formal API would help a lot. It may also help improve the testability and robustness of the core library, too!
Thoughts? Vincent
Issue Analytics
- State:
- Created 7 years ago
- Reactions:17
- Comments:16 (15 by maintainers)
Top Results From Across the Web
Some fast way to save and restore tabs of Terminal?
I would like to save the current configuration and have it restored with names and directories. Is there a way to do this?...
Read more >Save and restore terminal content - linux - Stack Overflow
I want to be able to restore terminal command history when my program exists. Many terminal programs (e.g. less , man , vim...
Read more >Save and restore terminal on reboot - linux - Super User
I would like to at least save the current working directories and name each tab works with so I can be more efficient....
Read more >Save and Restore a Linux Process | Baeldung on Linux
In this tutorial, we'll look at how we can save and restore a process that we can use across multiple reboots. While most...
Read more >How to restore manually Saved State files of Terminal?
Kill the terminal explicitly, e.g.: killall Terminal . Run again, it should have the previous message/state. Removing files and restoring from ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any updates on this one? I am also having a similar use case.
Some more things we probably want to serialize:
@parisk I was thinking a
getState
orserialize
function would perform the serialization at that point, we could put everything into some json object and return the json pretty easily. All the state you’re mentioning may not be owned by the Terminal object, for example the buffer lives inCircularList
. It would make more sense to tell theCircularList
to serialize itself on a call to the function. Something like this: