Skip to content

Commit 64c790f

Browse files
GobieGeoffreyBooth
authored andcommitted
[CS2] CLI: Propagate SIGINT and SIGTERM signals when node is forked (#4625)
* Propagate SIGINT and SIGTERM signals when node is forked * Use for loop for consistency
1 parent cbf035f commit 64c790f

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/coffeescript/command.js

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/command.coffee

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,9 @@ forkNode = ->
462462
cwd: process.cwd()
463463
env: process.env
464464
stdio: [0, 1, 2]
465+
for signal in ['SIGINT', 'SIGTERM']
466+
process.on signal, do (signal) ->
467+
-> p.kill signal
465468
p.on 'exit', (code) -> process.exit code
466469

467470
# Print the `--help` usage message and exit. Deprecated switches are not

0 commit comments

Comments
 (0)