Skip to content

feat(snapshot): daemon sends libghostty snapshots instead of raw bytestream - #243

Draft
neurosnap wants to merge 1 commit into
mainfrom
push-vtznxtxsltwy
Draft

feat(snapshot): daemon sends libghostty snapshots instead of raw bytestream#243
neurosnap wants to merge 1 commit into
mainfrom
push-vtznxtxsltwy

Conversation

@neurosnap

@neurosnap neurosnap commented Aug 18, 2026

Copy link
Copy Markdown
Owner

This allows zmx to directly inject terminal state into terminal emulators that speak libghostty's snapshot api.

This only impacts terminal rehydration of clients when they first attach to a zmx session.

What does this mean?

Terminal emulators that support loading libghostty snapshots directly can receive a perfect recreation of zmx's session instead of relying on us re-printing the ansi bytestream into every client that connects to a zmx session. Printing the bytestream mostly works but has some weird quirks and is not guaranteed to be identical -- it's an approximation. Using the snapshot API we get a much closer terminal "cloning" system.

Right now only monstar has experimental support for the snapshot api, but this is how it would work:

zmx attach snap.1
# do some terminal stuff
# close terminal and then use monstar:
monstar --attach="zmx attach -s snap.1"
# zmx will directly load the underlying `libghostty.Terminal` into `monstar`

Link: rockorager/monstar#35

…stream

This allows zmx to directly inject terminal state into terminal emulators that
speak libghostty's snapshot api.

This only impacts terminal rehydration of clients when they first attach to a
zmx session.

What does this mean?

Terminal emulators that support loading libghostty snapshots directly can
receive a perfect recreation of zmx's session instead of relying on us
re-printing the ansi bytestream into every client that connects to a zmx
session.

Right now only `monstar` has experimental support for the snapshot api, but this
is how it would work:

```bash
zmx attach snap.1
// do some terminal stuff
// close terminal and then use monstar:
monstar --attach="zmx attach -s snap.1"
// zmx will directly load the underlying `libghostty.Terminal` into `monstar`
```

Link: rockorager/monstar#35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant