Skip to content

feat(ext/signals): support additional signals on Windows#32689

Merged
bartlomieju merged 4 commits intodenoland:mainfrom
bartlomieju:fix/windows-signal-support
Mar 17, 2026
Merged

feat(ext/signals): support additional signals on Windows#32689
bartlomieju merged 4 commits intodenoland:mainfrom
bartlomieju:fix/windows-signal-support

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

Summary

  • Add SIGTERM, SIGQUIT, SIGKILL, and SIGABRT to the Windows signal dictionary, matching libuv's signal definitions
  • Deno.addSignalListener("SIGTERM", ...) and Deno.addSignalListener("SIGQUIT", ...) now work on Windows
  • Deno.kill() on Windows now accepts SIGINT, SIGQUIT, SIGKILL, SIGTERM, SIGABRT (all map to TerminateProcess), plus signal 0 for process health checks
  • SIGKILL and SIGABRT are forbidden for listeners (uncatchable/fatal), matching Unix behavior
  • Simplified signal error messages to a cross-platform format

Closes #26331

Test plan

  • Updated tests/unit/signal_test.ts — split the old signalsNotImplemented test into windowsUnsupportedSignalsTest, windowsForbiddenSignalsTest, and windowsSupportedSignalsTest
  • ./x test-unit signal passes
  • Format and lint pass

🤖 Generated with Claude Code

bartlomieju and others added 4 commits March 13, 2026 13:53
Add SIGTERM, SIGQUIT, SIGKILL, and SIGABRT to the Windows signal
dictionary, matching libuv's signal support. This enables:

- Deno.addSignalListener("SIGTERM", ...) on Windows
- Deno.addSignalListener("SIGQUIT", ...) on Windows
- Deno.kill(pid, "SIGQUIT") on Windows (terminates process)
- Deno.kill(pid, "SIGINT") on Windows (terminates process)
- Deno.kill(pid, 0) on Windows (health check, like Unix)

SIGKILL and SIGABRT are added to the dictionary for Deno.kill() but
are forbidden for signal listeners (matching Unix behavior where these
are uncatchable/fatal signals).

The Windows kill() function now accepts SIGINT, SIGQUIT, SIGKILL,
SIGTERM, and SIGABRT (all map to TerminateProcess), plus signal 0
for process existence checks.

Also simplifies the error messages to use a single cross-platform
"Invalid signal" format instead of Windows-specific text.

Closes denoland#26331

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These signals are not in the Windows signal dict, so they error with
"Invalid signal" rather than "Binding forbidden". Move them from the
forbidden test to the unsupported test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update JSDoc to reflect newly supported Windows signals: SIGTERM,
SIGQUIT, SIGHUP, and SIGWINCH.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@kajukitli kajukitli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changes. No issues found.

@bartlomieju bartlomieju merged commit 40c1da6 into denoland:main Mar 17, 2026
112 checks passed
@bartlomieju bartlomieju deleted the fix/windows-signal-support branch March 17, 2026 14:47
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.

support additional signals (SIGHUP, SIGKILL, etc) on windows

3 participants