# ZMX ZMX is session attach/detach for the terminal. Start a shell, walk away, come back and reattach with the session and its output intact. By neurosnap, sponsored by pico.sh, written in Zig, [[MIT License]]. Its scope is the interesting part: **it does session persistence and nothing else.** ## What it does - Attach and detach from shell sessions without killing them - **Native terminal scrollback restoration**, so reattaching gives you back real scrollback rather than a repainted screen - Multiple clients on the same session at once - Send commands to a session remotely - Read scrollback history as plain text - macOS and [[Linux]] Architecture is small: one daemon per session, each with its own Unix socket, and terminal state restored through `libghostty-vt` (the terminal engine from [[Ghostty]]), which captures and replays output and state when a client reconnects. Install via binaries, Homebrew, mise, nixpkgs, community packages for Alpine, Arch, openSUSE and Gentoo, or build from source with Zig. ## What it deliberately doesn't do No window management. No tabs. No splits. Those are your window manager's job. That's the whole design argument, and it's aimed at tmux. tmux bundles session persistence with a full multiplexer: panes, layouts, a keybinding language, its own copy mode. Most people adopt tmux for exactly one of those features and inherit the rest, including a scrollback implementation that fights the terminal rather than using it. ZMX takes the persistence and hands everything else back to software that already does it well. On a tiling setup, the window manager is better at splits than tmux is, and the terminal is better at scrollback than tmux is. ## Why I keep this note **It's the right kind of unbundling, and I'm the target user.** I run a tiling window manager. Hyprland already does splits, workspaces and layouts properly. Anything tmux would give me there is duplication with worse ergonomics and an extra keybinding prefix in front of everything. **Native scrollback is the actual feature.** tmux's copy mode is the thing I've never stopped resenting: search, selection and mouse scrolling all behave subtly wrong because the multiplexer is emulating what the terminal already does. Building on `libghostty-vt` means scrollback stays the terminal's job. **And it matters more now than it used to.** Long-running agent sessions are exactly the workload that needs detach and reattach: start something that runs for an hour, close the laptop, reattach later. That's the same need [[quotawake]] solves for quota resets, one layer down. "Read scrollback as plain text" is also quietly useful for anything that wants to inspect what a session did. The reason to be careful: this is a young project doing one job, against a tool that has been on every server for twenty years. If you need a multiplexer on a remote box you don't control, tmux is still the answer because it's already there. ## References - [zmx.sh](https://zmx.sh) — documentation - [neurosnap/zmx](https://github.com/neurosnap/zmx) — source - [Blog posts about zmx](https://bower.sh/?tag=zmx) - [IRC chat (#pico.sh on Libera)](https://web.libera.chat/gamja?autojoin=#pico.sh) - [pico.sh](https://pico.sh) — sponsor ## Related - [[Ghostty]] - [[Zellij]] - [[quotawake]] - [[Linux]] - [[Open Source]] - [[MIT License]]