repos / zmx

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

commit
5dc353a
parent
d3c12e1
author
Eric Bower
date
2025-12-06 11:15:51 -0500 EST
fix(attach): cannot attach to session within session

Closes: https://github.com/neurosnap/zmx/issues/20
1 files changed,  +4, -0
M src/main.zig
+4, -0
 1@@ -315,6 +315,10 @@ fn kill(cfg: *Cfg, session_name: []const u8) !void {
 2 }
 3 
 4 fn attach(daemon: *Daemon) !void {
 5+    if (std.posix.getenv("ZMX_SESSION")) |_| {
 6+        return error.CannotAttachToSessionInSession;
 7+    }
 8+
 9     var dir = try std.fs.openDirAbsolute(daemon.cfg.socket_dir, .{});
10     defer dir.close();
11