@@ -83,11 +83,18 @@ export async function main(
8383 hardexit = ( status ) => Deno . exit ( status ) ;
8484 try {
8585 Deno . addSignalListener ( "SIGINT" , interrupt . SIGINT ) ;
86- Deno . addSignalListener ( "SIGTERM" , interrupt . SIGTERM ) ;
86+ /**
87+ * Windows only supports ctrl-c (SIGINT), ctrl-break (SIGBREAK), and ctrl-close (SIGUP)
88+ */
89+ if ( Deno . build . os !== "windows" ) {
90+ Deno . addSignalListener ( "SIGTERM" , interrupt . SIGTERM ) ;
91+ }
8792 yield * body ( Deno . args . slice ( ) ) ;
8893 } finally {
8994 Deno . removeSignalListener ( "SIGINT" , interrupt . SIGINT ) ;
90- Deno . removeSignalListener ( "SIGTERM" , interrupt . SIGTERM ) ;
95+ if ( Deno . build . os !== "windows" ) {
96+ Deno . removeSignalListener ( "SIGTERM" , interrupt . SIGTERM ) ;
97+ }
9198 }
9299 } ,
93100 * node ( ) {
@@ -99,11 +106,15 @@ export async function main(
99106 hardexit = ( status ) => process . exit ( status ) ;
100107 try {
101108 process . on ( "SIGINT" , interrupt . SIGINT ) ;
102- process . on ( "SIGTERM" , interrupt . SIGTERM ) ;
109+ if ( process . platform !== "win32" ) {
110+ process . on ( "SIGTERM" , interrupt . SIGTERM ) ;
111+ }
103112 yield * body ( process . argv . slice ( 2 ) ) ;
104113 } finally {
105114 process . off ( "SIGINT" , interrupt . SIGINT ) ;
106- process . off ( "SIGTERM" , interrupt . SIGINT ) ;
115+ if ( process . platform !== "win32" ) {
116+ process . off ( "SIGTERM" , interrupt . SIGINT ) ;
117+ }
107118 }
108119 } ,
109120 * browser ( ) {
0 commit comments