repos / zmx

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

commit
6eea0f6
parent
fbf0171
author
Eric Bower
date
2026-04-12 13:23:59 -0400 EDT
chore: dont show task_command because it is unreliable

We just don't have a great way to send [][]u8 over ipc because
we are using structs with fixed size fields that are converted to/from
via std.mem.asBytes.  This means we have to convert the command from [][]u8
to []u8 but that makes our daemon struct fields complicated.

Instead, just rely on looking at the zmx history to understand the command
that was run.
1 files changed,  +1, -3
M src/main.zig
+1, -3
 1@@ -157,7 +157,6 @@ pub fn main() !void {
 2             .cwd = cwd,
 3             .created_at = @intCast(std.time.timestamp()),
 4             .is_task_mode = true,
 5-            .task_command = cmd_args_raw.items,
 6             .leader_client_fd = undefined,
 7         };
 8         daemon.socket_path = socket.getSocketPath(alloc, cfg.socket_dir, sesh) catch |err| switch (err) {
 9@@ -393,7 +392,6 @@ const Daemon = struct {
10     is_task_mode: bool = false, // flag for when session is run as a task
11     task_exit_code: ?u8 = null, // null = running or n/a, set when task completes
12     task_ended_at: ?u64 = null, // timestamp when task exited
13-    task_command: ?[]const []const u8 = null,
14     pty_write_buf: std.ArrayList(u8) = .empty,
15 
16     const EnsureSessionResult = struct {
17@@ -806,7 +804,7 @@ const Daemon = struct {
18         // shell-special characters so the displayed command is copy-pasteable.
19         var cmd_buf: [ipc.MAX_CMD_LEN]u8 = undefined;
20         var cmd_len: u16 = 0;
21-        const cur_cmd = self.command orelse self.task_command;
22+        const cur_cmd = self.command;
23         if (cur_cmd) |args| {
24             for (args, 0..) |arg, i| {
25                 const quoted = if (util.shellNeedsQuoting(arg))