repos / zmx

session persistence for terminal processes
git clone https://github.com/neurosnap/zmx.git

commit
b5e97df
parent
feb6f3c
author
Eric Bower
date
2025-12-08 23:12:07 -0500 EST
docs: comparison table
1 files changed,  +27, -8
M README.md
+27, -8
 1@@ -38,8 +38,7 @@ zig build -Doptimize=ReleaseSafe --prefix ~/.local
 2 
 3 ## usage
 4 
 5-> [!IMPORTANT]
 6-> Press `ctrl+\` to detach from the session.
 7+> [!IMPORTANT] Press `ctrl+\` to detach from the session.
 8 
 9 ```
10 Usage: zmx <command> [args]
11@@ -92,13 +91,13 @@ todo.
12 
13 ## philosophy
14 
15-The entire argument for `zmx` instead of something like `tmux` that has windows, panes, splits, etc. is that job should be handled by your os window manager.  By using something like `tmux` you now have redundent functionality in your dev stack: a window manager for your os and a window manager for your terminal.  Further, in order to use modern terminal features, your terminal emulator **and** `tmux` need to have support for them.  This holds back the terminal enthusiast community and feature development.
16+The entire argument for `zmx` instead of something like `tmux` that has windows, panes, splits, etc. is that job should be handled by your os window manager. By using something like `tmux` you now have redundent functionality in your dev stack: a window manager for your os and a window manager for your terminal. Further, in order to use modern terminal features, your terminal emulator **and** `tmux` need to have support for them. This holds back the terminal enthusiast community and feature development.
17 
18 Instead, this tool specifically focuses on session persistence and defers window management to your os wm.
19 
20 ## ssh workflow
21 
22-Using `zmx` with `ssh` is a first-class citizen.  Instead of `ssh`ing into your remote system with a single terminal and `n` tmux panes, you open `n` terminals and run `ssh` for all of them.  This might sound tedious, but there are tools to make this a delightful workflow.
23+Using `zmx` with `ssh` is a first-class citizen. Instead of `ssh`ing into your remote system with a single terminal and `n` tmux panes, you open `n` terminals and run `ssh` for all of them. This might sound tedious, but there are tools to make this a delightful workflow.
24 
25 First, create an `ssh` config entry for your remote dev server:
26 
27@@ -124,7 +123,7 @@ ssh d.dotfiles
28 
29 This will create or attach to each session and since we are using `ControlMaster` the same `ssh` connection is reused for every call to `ssh` for near-instant connection times.
30 
31-Now you can use the [`autossh`](https://linux.die.net/man/1/autossh) tool to make your ssh connections auto-reconnect.  For example, if you have a laptop and close/open your laptop lid it will automatically reconnect all your ssh connections:
32+Now you can use the [`autossh`](https://linux.die.net/man/1/autossh) tool to make your ssh connections auto-reconnect. For example, if you have a laptop and close/open your laptop lid it will automatically reconnect all your ssh connections:
33 
34 ```bash
35 autossh -M 0 -q d.term
36@@ -143,7 +142,7 @@ ash d.pico
37 ash d.dotifles
38 ```
39 
40-Wow!  Now you can setup all your os tiling windows how you like them for your project and have as many windows as you'd like, almost replicating exactly what `tmux` does but with native windows, tabs, splits, and scrollback!  It also has the added benefit of supporting all the terminal features your emulator supports, no longer restricted by what `tmux` supports.
41+Wow! Now you can setup all your os tiling windows how you like them for your project and have as many windows as you'd like, almost replicating exactly what `tmux` does but with native windows, tabs, splits, and scrollback! It also has the added benefit of supporting all the terminal features your emulator supports, no longer restricted by what `tmux` supports.
42 
43 ## socket file location
44 
45@@ -155,7 +154,7 @@ We store global logs for cli commands in `/tmp/zmx/logs/zmx.log`. We store sessi
46 
47 ## a note on configuration
48 
49-At this point, nothing is configurable.  We are evaluating what should be configurable and what should not.  Every configuration option is a burden for us maintainers.  For example, being able to change the default detach shortcut is difficult in a terminal environment.
50+At this point, nothing is configurable. We are evaluating what should be configurable and what should not. Every configuration option is a burden for us maintainers. For example, being able to change the default detach shortcut is difficult in a terminal environment.
51 
52 ## a smol contract
53 
54@@ -194,7 +193,7 @@ How it works:
55 - user re-attaches to session
56 - `ghostty-vt` sends terminal snapshot to client stdout
57 
58-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.  It also has the added benefit of being very fast, the only thing sitting in-between you and your PTY is a unix socket.
59+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. It also has the added benefit of being very fast, the only thing sitting in-between you and your PTY is a unix socket.
60 
61 ## prior art
62 
63@@ -215,3 +214,23 @@ The biggest advantage of this approach is that `shpool` does not break native sc
64 You can find the source code at this repo: https://github.com/martanne/abduco
65 
66 abduco provides session management i.e. it allows programs to be run independently from its controlling terminal. That is programs can be detached - run in the background - and then later reattached. Together with dvtm it provides a simpler and cleaner alternative to tmux or screen.
67+
68+### dtach
69+
70+You can find the source code at this repo: https://github.com/crigler/dtach
71+
72+A simple program that emulates the detach feature of screen.
73+
74+dtach is a program written in C that emulates the detach feature of screen, which allows a program to be executed in an environment that is protected from the controlling terminal. For instance, the program under the control of dtach would not be affected by the terminal being disconnected for some reason.
75+
76+## comparison
77+
78+| Feature                      | zmx | shpool | abduco | dtach |
79+| ---------------------------- | --- | ------ | ------ | ----- |
80+| Daemon per session           | ✓   | ✗      | ✓      | ✓     |
81+| Multiple clients per session | ✓   | ✗      | ✓      | ✓     |
82+| Terminal state restore       | ✓   | ✓      | ✗      | ✗     |
83+| Native scrollback            | ✓   | ✓      | ✓      | ✓     |
84+| Configurable detach key      | ✗   | ✓      | ✓      | ✓     |
85+| Auto-daemonize               | ✓   | ✓      | ✓      | ✓     |
86+| Session listing              | ✓   | ✓      | ✓      | ✗     |