Skip to content

fix: leeway <command> overrides env in any case, exits 128+signal, forwards SIGWINCH - #91

Merged
OhadC merged 1 commit into
mainfrom
run-env-case-signal-exit
Nov 21, 2026
Merged

OhadC merged 1 commit into
mainfrom
run-env-case-signal-exit

Conversation

@OhadC

@OhadC OhadC commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Closes #88

Summary

 RunWithPorts.runAndExit
-  spawn(..., env: { ...process.env, ...ports })   # plain object: PORT_WEB and port_web both reach the child on Windows
+  overrideInheritedEnv(ports)                     # writes into case-insensitive process.env
+  spawn(...)                                      # default env
   POSIX forwarded signals
-    SIGINT SIGTERM SIGHUP SIGQUIT
+    SIGINT SIGTERM SIGHUP SIGQUIT SIGWINCH
   on child exit
-    signal ? 1 : code
+    signal ? 128 + os.constants.signals[signal] (1 if unknown) : code

README (exit codes, env override, resize) and ADR 0001 (forwarded signals) match.

Evidence

  • Before:
    • Windows: parent PORT_WEB=9999, port name port_web → child prints 9999 (new test red)
    • linux: leeway gets SIGINT/SIGTERM/SIGHUP/SIGQUIT → exits 1; SIGWINCH never reaches the command (5 signal tests red)
  • After:
    • child prints 5173; exits 130/143/129/131; command prints resized
    • pnpm verify green on Windows (352 passed)
    • linux suite run via docker: all CLI tests green; one unrelated src/vite.test.ts failure (in-process vite, ECONNREFUSED, likely docker networking — pnpm test:linux itself not run, no podman)

Merge Danger

Door: two-way

Blast Radius: exit-codes

Scripts or CI that checked for leeway exiting 1 after a signal now see 128+n. On Windows, a parent variable differing only by case no longer wins over leeway's port.

@OhadC
OhadC merged commit 873e52c into main Nov 21, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

leeway <command>: case-colliding env on Windows, exit code on signal, no SIGWINCH

1 participant