repos / zmx

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

commit
87dc8d1
parent
24305c0
author
Eric Bower
date
2026-04-16 20:32:29 -0400 EDT
fix: default to bash when running command
2 files changed,  +21, -18
M README.md
+10, -7
 1@@ -102,17 +102,20 @@ History:
 2     zmx history <session> | tail -100
 3 
 4 Run:
 5-  Commands are passed as-is; do not wrap in quotes.
 6-  Commands run sequentially; do not send multiple in parallel.
 7-  Avoid interactive programs (pagers, editors, prompts) -- they hang.
 8-
 9-  `-d` will detach from the calling terminal. Use `wait` to track
10-  its status.
11+  Commands are passed as-is: do not wrap in quotes.
12+  Commands run sequentially: do not send multiple in parallel.
13+  Avoid interactive programs (pagers, editors, prompts): they hang.
14 
15   `--fish` is required when the session runs fish shell.
16 
17   If the command hangs, send Ctrl+C to recover:
18-    zmx run <session> $'\\x03'
19+    zmx run <session> $(printf '\x03')
20+
21+  If the command hangs, print the history to see the error:
22+    zmx history <session> | tail -100
23+
24+  `-d` will detach from the calling terminal. Use `wait` to track
25+  its status.
26 
27   Examples:
28     zmx run dev ls
M src/main.zig
+11, -11
 1@@ -154,12 +154,9 @@ pub fn main() !void {
 2 
 3         var cmd_args_raw: std.ArrayList([]const u8) = .empty;
 4         defer cmd_args_raw.deinit(alloc);
 5-        const shell = util.detectShell();
 6-        var shell_basename = std.fs.path.basename(shell);
 7+        var shell_basename: []const u8 = "bash";
 8         var detached = false;
 9         while (args.next()) |arg| {
10-            // TODO: detect shell within the session instead of asking the user to tell us
11-            // if the shell is fish.
12             // Because fish tracks exit code status via $status instead of $? we need some
13             // way to figure out what shell is being used inside the session.
14             if (std.mem.startsWith(u8, arg, "--fish")) {
15@@ -1160,17 +1157,20 @@ fn help() !void {
16         \\    zmx history <session> | tail -100
17         \\
18         \\Run:
19-        \\  Commands are passed as-is; do not wrap in quotes.
20-        \\  Commands run sequentially; do not send multiple in parallel.
21-        \\  Avoid interactive programs (pagers, editors, prompts) -- they hang.
22-        \\
23-        \\  `-d` will detach from the calling terminal. Use `wait` to track
24-        \\  its status.
25+        \\  Commands are passed as-is: do not wrap in quotes.
26+        \\  Commands run sequentially: do not send multiple in parallel.
27+        \\  Avoid interactive programs (pagers, editors, prompts): they hang.
28         \\
29         \\  `--fish` is required when the session runs fish shell.
30         \\
31         \\  If the command hangs, send Ctrl+C to recover:
32-        \\    zmx run <session> printf '\x03'
33+        \\    zmx run <session> $(printf '\x03')
34+        \\
35+        \\  If the command hangs, print the history to see the error:
36+        \\    zmx history <session> | tail -100
37+        \\
38+        \\  `-d` will detach from the calling terminal. Use `wait` to track
39+        \\  its status.
40         \\
41         \\  Examples:
42         \\    zmx run dev ls