3

I have a simple nodejs application like

...
function checkTermination () {
  console.log('start closing ...');
  ...
}
process.on('SIGTERM', checkTermination);
process.on('SIGINT', checkTermination);

I'm debugging it with Visual Studio Code.

Is there an opportunity to send some signals like SIGINT, SIGTERM to the application with "Visual Studio Code" ? How can I do this?

2 Answers 2

5
  1. Find the process ID
  2. Send the Signal

I have a program named test.js, attached to VS code.

ps aux | grep node | grep test
//Result
user1           3580   0.0  0.2  3115916  35648   ??  S     3:29PM   0:00.29 /usr/local/bin/node --inspect-brk=48750 test.js
// Send the signal
kill -TERM 3580 // 3580 is the PID

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

0

When launched:

When attached to:

See https://github.com/microsoft/vscode-node-debug/issues/1#issuecomment-405123769

1 Comment

Funny this never worked for me, let me retry this again today..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.