repos / zmx

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

commit
27742ab
parent
aaffdce
author
Eric Bower
date
2025-11-28 22:35:33 -0500 EST
feat: shorthand aliases for commands
2 files changed,  +15, -15
M README.md
+5, -5
 1@@ -28,11 +28,11 @@ session persistence for terminal processes
 2 Usage: zmx <command> [args]
 3 
 4 Commands:
 5-  attach <name> [command...]  Create or attach to a session
 6-  detach                      Detach all clients from current session  (ctrl+\ for current client)
 7-  list                        List active sessions
 8-  kill <name>                 Kill a session and all attached clients
 9-  help                        Show this help message
10+  [a]ttach <name> [command...]  Create or attach to a session
11+  [d]etach                      Detach all clients from current session  (ctrl+\ for current client)
12+  [l]ist                        List active sessions
13+  [k]ill <name>                 Kill a session and all attached clients
14+  [h]elp                        Show this help message
15 ```
16 
17 ### examples
M src/main.zig
+10, -10
 1@@ -134,19 +134,19 @@ pub fn main() !void {
 2         return list(&cfg);
 3     };
 4 
 5-    if (std.mem.eql(u8, cmd, "help")) {
 6+    if (std.mem.eql(u8, cmd, "help") or std.mem.eql(u8, cmd, "h")) {
 7         return help();
 8-    } else if (std.mem.eql(u8, cmd, "list")) {
 9+    } else if (std.mem.eql(u8, cmd, "list") or std.mem.eql(u8, cmd, "l")) {
10         return list(&cfg);
11-    } else if (std.mem.eql(u8, cmd, "detach")) {
12+    } else if (std.mem.eql(u8, cmd, "detach") or std.mem.eql(u8, cmd, "d")) {
13         return detachAll(&cfg);
14-    } else if (std.mem.eql(u8, cmd, "kill")) {
15+    } else if (std.mem.eql(u8, cmd, "kill") or std.mem.eql(u8, cmd, "k")) {
16         const session_name = args.next() orelse {
17             std.log.err("session name required", .{});
18             return;
19         };
20         return kill(&cfg, session_name);
21-    } else if (std.mem.eql(u8, cmd, "attach")) {
22+    } else if (std.mem.eql(u8, cmd, "attach") or std.mem.eql(u8, cmd, "a")) {
23         const session_name = args.next() orelse {
24             std.log.err("session name required", .{});
25             return;
26@@ -188,11 +188,11 @@ fn help() !void {
27         \\Usage: zmx <command> [args]
28         \\
29         \\Commands:
30-        \\  attach <name> [command...]  Create or attach to a session
31-        \\  detach                      Detach all clients from current session (ctrl+\ for current client)
32-        \\  list                        List active sessions
33-        \\  kill <name>                 Kill a session and all attached clients
34-        \\  help                        Show this help message
35+        \\  [a]ttach <name> [command...]  Create or attach to a session
36+        \\  [d]etach                      Detach all clients from current session (ctrl+\ for current client)
37+        \\  [l]ist                        List active sessions
38+        \\  [k]ill <name>                 Kill a session and all attached clients
39+        \\  [h]elp                        Show this help message
40         \\
41     ;
42     try std.fs.File.stdout().writeAll(help_text);