Skip to content

fix: forward SIGQUIT to the command process group - #85

Merged
OhadC merged 3 commits into
mainfrom
forward-sigquit
Nov 21, 2026
Merged

OhadC merged 3 commits into
mainfrom
forward-sigquit

Conversation

@OhadC

@OhadC OhadC commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Summary

On Linux and macOS, Ctrl+\ now stops the command tree too: leeway forwards SIGQUIT to the command's process group, the same way it forwards the other stop signals.

 POSIX_FORWARDED_SIGNALS
   SIGINT
   SIGTERM
   SIGHUP
+  SIGQUIT

The README's line on stopping leeway now names each stop key and signal for each OS. The ADR's list of forwarded signals now includes SIGQUIT.

Evidence

Test: leeway <command> on a signal > %s stops the whole command tree, so nothing is left listening, now run for SIGQUIT too (pnpm test:linux).

  • Before: SIGQUIT fails at expect(await stopsAnswering(port)).toBe(true). leeway dies, but its command keeps holding the port.
    After: all four signals pass. pnpm verify, pnpm test:linux and pnpm test:package are green.

Merge Danger

Door: two-way

Blast Radius: small

Ctrl+\ / SIGQUIT now stops the command instead of killing only leeway. leeway exits 1, or with the command's own exit code. It no longer core-dumps from SIGQUIT.

Closes #40

@OhadC

OhadC commented Nov 15, 2026

Copy link
Copy Markdown
Owner Author

Written by Claude (AI assistant) on behalf of @OhadC.

Review by a separate agent: acceptance criteria of #40 met; the README over-claimed.

Finding Outcome
Reproduced on Linux: a command that handles SIGQUIT and keeps running (a JVM prints a thread dump) is still left on its ports. sh above it dies of the signal, so leeway exits 1 documented, not changed: README Limits now says so and points at leeway kill. It holds for any signal a command handles without exiting, and was so before this PR; turning Ctrl+\ into a stop would take the thread dump away
README: Ctrl+\, renders as Ctrl+, fixed: code span
README: "Ctrl+\ stops the whole command tree" is false for such a command fixed: the sentence says the tree gets the signal leeway got
The test's "exits non-zero" passes when leeway dies of the signal (null is not 0) left: the port check is what fails without the fix, and the exit code after a signal differs between dash and bash
Processes that do not handle SIGQUIT dump core where core dumps are on left: what Ctrl+\ does in any terminal

@OhadC
OhadC merged commit 2824c48 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.

Ctrl+\ kills leeway and leaves its command running

1 participant