From 24571a395203aad7cda07ffef0ef64285351e42b Mon Sep 17 00:00:00 2001 From: Geert-Jan Zwiers Date: Mon, 13 Jun 2022 22:39:46 +0200 Subject: feat(runtime/signal): implement SIGINT and SIGBREAK for windows (#14694) This commit adds support for SIGINT and SIGBREAK signals on Windows platform. Co-authored-by: orange soeur --- cli/dts/lib.deno.ns.d.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cli/dts') diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index 9ef1370ec..f9c999cb3 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -2342,6 +2342,7 @@ declare namespace Deno { export type Signal = | "SIGABRT" | "SIGALRM" + | "SIGBREAK" | "SIGBUS" | "SIGCHLD" | "SIGCONT" @@ -2382,7 +2383,7 @@ declare namespace Deno { * }); * ``` * - * NOTE: This functionality is not yet implemented on Windows. + * NOTE: On Windows only SIGINT (ctrl+c) and SIGBREAK (ctrl+break) are supported. */ export function addSignalListener(signal: Signal, handler: () => void): void; @@ -2397,7 +2398,7 @@ declare namespace Deno { * Deno.removeSignalListener("SIGTERM", listener); * ``` * - * NOTE: This functionality is not yet implemented on Windows. + * NOTE: On Windows only SIGINT (ctrl+c) and SIGBREAK (ctrl+break) are supported. */ export function removeSignalListener( signal: Signal, @@ -2937,7 +2938,8 @@ declare namespace Deno { /** Send a signal to process under given `pid`. * * If `pid` is negative, the signal will be sent to the process group - * identified by `pid`. + * identified by `pid`. An error will be thrown if a negative + * `pid` is used on Windows. * * ```ts * const p = Deno.run({ -- cgit v1.2.3