Zmx: Session Persistence for Terminal Processes
7 days ago
- #session-persistence
- #productivity
- #terminal
- zmx is a tool for persisting terminal shell sessions (pty processes) allowing users to attach and detach without killing the session.
- It supports native terminal scrollback and multiple clients connecting to the same session, restoring previous terminal state and output upon reattachment.
- Works on Mac and Linux, requires Zig for building, and focuses solely on session persistence, deferring window management to the OS.
- Usage includes commands for attaching, detaching, listing, and killing sessions, with specific examples provided for starting sessions with different applications.
- Integration with SSH is highlighted as a first-class feature, enabling multiple terminal sessions with auto-reconnect capabilities via autossh.
- The tool uses Unix sockets for communication between daemon and client processes, leveraging libghostty-vt for terminal state restoration.
- Configuration is currently minimal, with logs and socket files stored in /tmp/zmx, aiming for simplicity and maintainability.
- Inspiration drawn from similar projects like shpool and abduco, emphasizing lightweight session persistence without the overhead of full terminal multiplexers like tmux.