diff --git a/examples/tutorials/os_signals.md b/examples/tutorials/os_signals.md index 0a5d52743..7581576a3 100644 --- a/examples/tutorials/os_signals.md +++ b/examples/tutorials/os_signals.md @@ -8,7 +8,8 @@ oldUrl: - /runtime/tutorials/os_signals/ --- -> ⚠️ Windows only supports listening for SIGINT and SIGBREAK as of Deno v1.23. +> ⚠️ Windows supports listening for `SIGINT`, `SIGBREAK`, `SIGTERM`, and +> `SIGQUIT` (the latter two via libuv's Windows signal emulation). ## Concepts @@ -75,3 +76,18 @@ Run with: ```shell deno run signal_listeners.ts ``` + +## Windows support + +The supported signal set differs between platforms. The Windows-specific +behavior is: + +| Use case | Supported signals on Windows | +| -------------------------------- | ------------------------------------------------------------------------------------------------------------ | +| `Deno.addSignalListener(sig, …)` | `SIGINT`, `SIGBREAK`, `SIGTERM`, `SIGQUIT` | +| `Deno.kill(pid, sig)` | `SIGINT`, `SIGBREAK`, `SIGTERM`, `SIGQUIT`, `SIGKILL`, `SIGABRT`, plus signal `0` for a process-health check | + +`SIGKILL` and `SIGABRT` are deliberately **not** registerable via +`addSignalListener` — they're uncatchable / fatal, matching Unix semantics. On +Windows the catchable signals all forward to libuv's emulation layer; signals +sent via `Deno.kill` ultimately invoke `TerminateProcess`.