Skip to content

Commit 04d061c

Browse files
Workaround Ctrl+C not exiting debug process
During `tns debug ios` command, Ctrl + C does not kill the proecss. It looks like there are still resources that do not allow the process to die. Implement a workaround - call process.exit when SIGINT (Ctrl + C) is received. There's no guarantee that this will release the other resources. However CLI's process will definitely die and console will be released. Code is based on this PR: telerik/mobile-cli-lib#791
1 parent 182e92c commit 04d061c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/nativescript-cli.ts

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ fiber(() => {
2020
let messages: IMessagesService = $injector.resolve("$messagesService");
2121
messages.pathsToMessageJsonFiles = [/* Place client-specific json message file paths here */];
2222

23+
let processService: IProcessService = $injector.resolve("$processService");
24+
processService.attachToProcessExitSignals(this, process.exit);
25+
2326
if (process.argv[2] === "completion") {
2427
commandDispatcher.completeCommand().wait();
2528
} else {

0 commit comments

Comments
 (0)