zmx: session persistence for terminal processes

78 points by erock


Greetings! After a couple of months of R&D I finally reached a place with this project where I'm using it as a fulltime replacement for what I would normally use tmux for: session persistence of terminal processes

This essentially extracts the attach/detach functionality from tmux and turns it into its own tool. Instead of using tmux for windows, tabs, and splits, you would instead leverage your own window manager to handle that.

Another neat aspect of this tool is terminal state and history restoration using libghostty-vt. We use libghostty-vt to restore the previous state of the terminal when a client re-attaches to a session.

How it works:

- user creates session zmx attach term
- user interacts with terminal stdin
- stdin gets sent to pty via daemon
- daemon sends pty output to client and ghostty-vt
- ghostty-vt holds terminal state and scrollback
- user disconnects
- user re-attaches to session
- ghostty-vt sends terminal snapshot to client stdout

In this way, ghostty-vt doesn't sit in the middle of an active terminal session, it simply receives all the same data the client receives so it can re-hydrate clients that connect to the session. This enables users to pick up where they left off as if they didn't disconnect from the terminal session at all.

zie

I've seen this trend pick up to avoid tmux/screen like tools. It's an interesting/new way of working from how I have been. I use mosh and of course then use tmux on the far side, so I get multiple windows.

I don't think there are terminal features I need that I would use, so the switch currently isn't worth the hassle to me, but this tool seems like it's finally possible to use this workflow.

I came from really terrible links, so mosh was like a miracle when I first started using it. Now my connections aren't usually speed limited, so I don't need mosh anymore, but habit you know. :)

Perhaps some terminal somewhere will get some new whizbang feature that I really want and make the switch, but until that time I don't think it's worth the hassle, but I'm glad tools like this exist to explore the problem space.

Or maybe I'll move to Arcan instead.

chinmay

can you explain how it is different from shpool?