repos / zmx

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

commit
0dd41e3
parent
ea6a7e5
author
Eric Bower
date
2025-10-11 11:24:05 -0400 EDT
feat: systemd unit file

docs: agents+readme
3 files changed,  +40, -17
M AGENTS.md
+7, -17
 1@@ -2,6 +2,8 @@
 2 
 3 The goal of this project is to create a way to attach and detach terminal sessions without killing the underlying linux process.
 4 
 5+When researching `zmx`, also read the README.md in the root of this project directory to learn more about the features, documentation, prior art, etc.
 6+
 7 ## tech stack
 8 
 9 - `zig` v0.15.1
10@@ -18,7 +20,7 @@ The goal of this project is to create a way to attach and detach terminal sessio
11 - **Test filter (Zig)**: `zig build test -Dtest-filter=<test name>`
12 - **Formatting (Zig)**: `zig fmt .`
13 
14-## finding library source code
15+## find any library API definitions
16 
17 Before trying anything else, run the `zigdoc` command to find an API with documentation:
18 
19@@ -27,7 +29,7 @@ zigdoc {symbol}
20 # examples
21 zigdoc ghostty-vt
22 zigdoc clap
23-zigdoc libxev
24+zigdoc xev
25 zigdoc std.ArrayList
26 zigdoc std.mem.Allocator
27 zigdoc std.http.Server
28@@ -35,26 +37,14 @@ zigdoc std.http.Server
29 
30 Only if that doesn't work should you grep the project dir.
31 
32-## finding libxev source code
33+## find libxev source code
34 
35 To inspect the source code for libxev, look inside the `libxev_src` folder.
36 
37-## finding zig std library source code
38+## find zig std library source code
39 
40 To inspect the source code for zig's standard library, look inside the `zig_std_src` folder.
41 
42-## finding ghostty library source code
43+## find ghostty library source code
44 
45 To inspect the source code for zig's standard library, look inside the `ghostty_src` folder.
46-
47-### prior art - shpool
48-
49-The project that most closely resembles `shpool`.
50-
51-You can find the source code at this repo: https://github.com/shell-pool/shpool
52-
53-`shpool` is a service that enables session persistence by allowing the creation of named shell sessions owned by `shpool` so that the session is not lost if the connection drops.
54-
55-`shpool` can be thought of as a lighter weight alternative to tmux or GNU screen. While tmux and screen take over the whole terminal and provide window splitting and tiling features, `shpool` only provides persistent sessions.
56-
57-The biggest advantage of this approach is that `shpool` does not break native scrollback or copy-paste.
M README.md
+16, -0
 1@@ -30,3 +30,19 @@
 2 - `zmx detach` (or Ctrl+b + d) - detach from session while keeping pty alive
 3 - `zmx list` - list sessions
 4 - `zmx kill <session_name>` kill pty and all clients attached to session
 5+
 6+## prior art
 7+
 8+Below is a list of projects that inspired me to build this project.
 9+
10+### shpool
11+
12+The project that most closely resembles `shpool`.
13+
14+You can find the source code at this repo: https://github.com/shell-pool/shpool
15+
16+`shpool` is a service that enables session persistence by allowing the creation of named shell sessions owned by `shpool` so that the session is not lost if the connection drops.
17+
18+`shpool` can be thought of as a lighter weight alternative to tmux or GNU screen. While tmux and screen take over the whole terminal and provide window splitting and tiling features, `shpool` only provides persistent sessions.
19+
20+The biggest advantage of this approach is that `shpool` does not break native scrollback or copy-paste.
A systemd/zmx.service
+17, -0
 1@@ -0,0 +1,17 @@
 2+[Unit]
 3+Description=zmx daemon - terminal session persistence
 4+Documentation=https://github.com/neurosnap/zmx
 5+After=local-fs.target
 6+
 7+[Service]
 8+Type=simple
 9+ExecStart=%h/.local/bin/zmx daemon
10+Restart=on-failure
11+RestartSec=5
12+
13+# Security hardening
14+NoNewPrivileges=true
15+PrivateTmp=true
16+
17+[Install]
18+WantedBy=default.target