Skip to content

feat: live collaborative terminal sharing - #35

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

feat: live collaborative terminal sharing#35
neurosnap wants to merge 1 commit into
mainfrom
push-nksmnzwzvwuz

Conversation

@neurosnap

@neurosnap neurosnap commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

This uses libghostty's experimental snapshot api to stream a terminal to/from a subprocess via stdin/stdout pipes. It supports saving and restoring snapshots from a file or even terminal sharing across a network. It shares the entire terminal state and scrollback history of libghostty.Terminal.

Link: ghostty-org/ghostty#13534
Link: neurosnap/zmx#243

Demo:

monstar-share.mp4

Comment thread build.zig.zon Outdated
neurosnap added a commit to neurosnap/zmx that referenced this pull request Aug 18, 2026
…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
neurosnap added a commit to neurosnap/zmx that referenced this pull request Aug 19, 2026
…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
neurosnap added a commit to neurosnap/zmx that referenced this pull request Aug 19, 2026
…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
neurosnap added a commit to neurosnap/zmx that referenced this pull request Aug 19, 2026
…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
neurosnap added a commit to neurosnap/zmx that referenced this pull request Aug 19, 2026
…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
@neurosnap
neurosnap force-pushed the push-nksmnzwzvwuz branch 2 times, most recently from f5b2ff3 to c4abee2 Compare August 19, 2026 18:57
neurosnap added a commit to neurosnap/zmx that referenced this pull request Aug 19, 2026
…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
This uses libghostty's experimental snapshot api to stream a terminal to/from a
subprocess via stdin/stdout pipes.  It supports saving and restoring snapshots
from a file or even terminal sharing.  It shares the entire terminal state and
scrollback history of libghostty.Terminal.

Link: ghostty-org/ghostty#13534
neurosnap added a commit to neurosnap/zmx that referenced this pull request Aug 19, 2026
…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
neurosnap added a commit to neurosnap/zmx that referenced this pull request Aug 20, 2026
…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
neurosnap added a commit to neurosnap/zmx that referenced this pull request Aug 30, 2026
…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