Commit 87dc8d1

Eric Bower  ·  2026-04-16 20:32:29 -0400 EDT
parent 24305c0
fix: default to bash when running command
2 files changed,  +21, -18
+10, -7
......@@ -102,17 +102,20 @@ History:
102102 zmx history <session> | tail -100
103103
104104 Run:
105- Commands are passed as-is; do not wrap in quotes.
106- Commands run sequentially; do not send multiple in parallel.
107- Avoid interactive programs (pagers, editors, prompts) -- they hang.
108-
109- `-d` will detach from the calling terminal. Use `wait` to track
110- its status.
105+ Commands are passed as-is: do not wrap in quotes.
106+ Commands run sequentially: do not send multiple in parallel.
107+ Avoid interactive programs (pagers, editors, prompts): they hang.
111108
112109 `--fish` is required when the session runs fish shell.
113110
114111 If the command hangs, send Ctrl+C to recover:
115- zmx run <session> $'\\x03'
112+ zmx run <session> $(printf '\x03')
113+
114+ If the command hangs, print the history to see the error:
115+ zmx history <session> | tail -100
116+
117+ `-d` will detach from the calling terminal. Use `wait` to track
118+ its status.
116119
117120 Examples:
118121 zmx run dev ls
+11, -11
......@@ -154,12 +154,9 @@ pub fn main() !void {
154154
155155 var cmd_args_raw: std.ArrayList([]const u8) = .empty;
156156 defer cmd_args_raw.deinit(alloc);
157- const shell = util.detectShell();
158- var shell_basename = std.fs.path.basename(shell);
157+ var shell_basename: []const u8 = "bash";
159158 var detached = false;
160159 while (args.next()) |arg| {
161- // TODO: detect shell within the session instead of asking the user to tell us
162- // if the shell is fish.
163160 // Because fish tracks exit code status via $status instead of $? we need some
164161 // way to figure out what shell is being used inside the session.
165162 if (std.mem.startsWith(u8, arg, "--fish")) {
......@@ -1160,17 +1157,20 @@ fn help() !void {
11601157 \\ zmx history <session> | tail -100
11611158 \\
11621159 \\Run:
1163- \\ Commands are passed as-is; do not wrap in quotes.
1164- \\ Commands run sequentially; do not send multiple in parallel.
1165- \\ Avoid interactive programs (pagers, editors, prompts) -- they hang.
1166- \\
1167- \\ `-d` will detach from the calling terminal. Use `wait` to track
1168- \\ its status.
1160+ \\ Commands are passed as-is: do not wrap in quotes.
1161+ \\ Commands run sequentially: do not send multiple in parallel.
1162+ \\ Avoid interactive programs (pagers, editors, prompts): they hang.
11691163 \\
11701164 \\ `--fish` is required when the session runs fish shell.
11711165 \\
11721166 \\ If the command hangs, send Ctrl+C to recover:
1173- \\ zmx run <session> printf '\x03'
1167+ \\ zmx run <session> $(printf '\x03')
1168+ \\
1169+ \\ If the command hangs, print the history to see the error:
1170+ \\ zmx history <session> | tail -100
1171+ \\
1172+ \\ `-d` will detach from the calling terminal. Use `wait` to track
1173+ \\ its status.
11741174 \\
11751175 \\ Examples:
11761176 \\ zmx run dev ls