Commit d469b2e

Eric Bower  ·  2026-06-12 20:07:58 -0400 EDT
parent d4d5f2a
chore(ci): cleanup
7 files changed,  +11, -38
+1, -0
......@@ -3,6 +3,7 @@
33 .zig-cache/
44 zig-cache/
55 zig-out/
6+zig-pkg/
67 Session*.*vim
78 commit_msg
89 *.sw?
+2, -3
......@@ -12,9 +12,8 @@ Use spec: https://common-changelog.org/
1212
1313 ### Changed
1414
15-- *BREAKING* `zmx run` when creating session it runs `/bin/bash` instead of `$SHELL`
16- - There are just too many edge cases with tracking exit status in other shells which makes
17- `zmx run` much less useful for task management.
15+- *BREAKING* `zmx run` when creating session it runs `bash` instead of `$SHELL`
16+ - There are just too many edge cases with tracking exit status in other shells which makes `zmx run` much less useful for task management.
1817 - This means when using `zmx run` the target shell must have support for `$?` exit code tracking
1918 - *BREAKING* `zmx tail` now strips ansi escape codes
2019
+1, -3
......@@ -15,8 +15,6 @@ WORKDIR /app
1515
1616 COPY . /app/
1717
18-RUN rm ./mise.toml
19-
2018 RUN zig build
2119
22-CMD ["zig", "build", "-Doptimize=ReleaseSafe"]
20+CMD ["zig", "build"]
+0, -7
......@@ -1,7 +0,0 @@
1-[tools]
2-zig = "0.15.2"
3-zls = "0.15.1"
4-bats = "1.13.0"
5-
6-[tasks.test_int]
7-run = "bats test/session.bats"
+0, -7
......@@ -6,13 +6,6 @@ EVENT_TYPE="${PICO_CI_EVENT_TYPE:-manual}"
66
77 echo "running ci event=${EVENT_TYPE} session=${ZMX_SESSION_PREFIX}"
88
9-if ! command -v mise &> /dev/null; then
10- echo "ERR: mise is required"
11- exit 1
12-fi
13-
14-zmx run install bash -c "mise trust && mise install"
15-
169 zmx run build docker build -t zig-zmx .
1710 zmx run fmt -d docker run --rm -t zig-zmx:latest zig fmt --check .
1811 zmx run test -d docker run --rm -t zig-zmx:latest zig build test
+5, -17
......@@ -1140,30 +1140,14 @@ const Daemon = struct {
11401140
11411141 const cmd = payload;
11421142
1143- // Prefix the command with environment variables to prevent it from
1144- // blocking. Commands run in a PTY where stdout looks like a TTY,
1145- // so programs like git/man/less will open a pager and hang. We set
1146- // pager-related env vars to force non-interactive behavior:
1147- // PAGER=cat — default pager fallback
1148- // GIT_PAGER=cat — git ignores PAGER, uses its own
1149- // LESS=-F — auto-exit if content fits (catches edge cases)
1150- // MANPAGER=cat — man overrides PAGER with MANPAGER
1151- // COLORTERM= — disable color (avoid ANSI in output)
1152- // Plus < /dev/null to prevent programs that read stdin from blocking.
1153- //
1154- // Commands that legitimately need stdin should use `zmx send`
1155- // instead, or pipe data directly: `echo data | zmx run dev cat`.
1156- const cmd_prefix = "PAGER=cat GIT_PAGER=cat LESS=-F MANPAGER=cat COLORTERM= < /dev/null ";
1157-
11581143 // Chain the exit marker with `;` on the same line. `$?` captures the
11591144 // exit code of the command (not the `;`). The sole exception is when
1160- // the command contains a heredoc (`<<`) — the delimiter must be alone
1145+ // the command contains a heredoc (`<<`), the delimiter must be alone
11611146 // on its line, so the marker goes on the next line instead.
11621147 const single_line_marker = "; echo ZMX_TASK_COMPLETED:$?\r";
11631148 const heredoc_marker = "\r\necho ZMX_TASK_COMPLETED:$?\r";
11641149 const uses_heredoc = std.mem.indexOf(u8, cmd, "<<") != null;
11651150
1166- self.queuePtyInput(cmd_prefix);
11671151 if (cmd.len > 0 and cmd[cmd.len - 1] == '\r') {
11681152 self.queuePtyInput(cmd[0 .. cmd.len - 1]);
11691153 } else {
......@@ -1316,6 +1300,10 @@ fn help() !void {
13161300 \\ zmx run dev git log --oneline # pager won't block
13171301 \\ echo "hello" | zmx run dev cat # piped stdin still works
13181302 \\
1303+ \\ # heredoc
1304+ \\ printf "cat << 'EOF'\r\nHello $USER\r\nToday is $(date).\r\nEOF" | zmx run dev
1305+ \\
1306+ \\ # non-blocking
13191307 \\ zmx run dev -d sleep 10
13201308 \\ zmx wait dev
13211309 \\
+2, -1
......@@ -352,7 +352,8 @@ pub fn findTaskExitMarker(output: []const u8) ?u8 {
352352
353353 /// Strip ANSI escape sequences from data, returning only printable characters
354354 /// and essential whitespace (CR, LF, tab, backspace). Uses the ghostty VT
355-/// parser to correctly handle multi-byte sequences (CSI, OSC, DCS, etc.).n/// The returned slice is owned by the caller and must be freed.
355+/// parser to correctly handle multi-byte sequences (CSI, OSC, DCS, etc.).
356+/// The returned slice is owned by the caller and must be freed.
356357 pub fn stripAnsi(alloc: std.mem.Allocator, data: []const u8) ![]const u8 {
357358 var result = std.ArrayList(u8).initCapacity(alloc, data.len) catch unreachable;
358359 defer result.deinit(alloc);