[英]Send signals to a debugged nodejs application in Visual Studio Code
I have a simple nodejs application like我有一个简单的 nodejs 应用程序,例如
...
function checkTermination () {
console.log('start closing ...');
...
}
process.on('SIGTERM', checkTermination);
process.on('SIGINT', checkTermination);
I'm debugging it with Visual Studio Code.我正在使用 Visual Studio Code 调试它。
Is there an opportunity to send some signals like SIGINT
, SIGTERM
to the application with "Visual Studio Code" ?是否有机会使用“Visual Studio Code”向应用程序发送诸如SIGINT
、 SIGTERM
类的SIGINT
? How can I do this?我怎样才能做到这一点?
I have a program named test.js, attached to VS code.我有一个名为 test.js 的程序,附加到 VS 代码。
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
When launched:启动时:
'SIGINT'
signal to your process按一次调试工具栏中的停止按钮(运行 > 停止调试,或 Shift + F5),向您的进程发送'SIGINT'
信号
'SIGKILL'
第二次按下它,它会发送'SIGKILL'
When attached to:当附加到:
See https://github.com/microsoft/vscode-node-debug/issues/1#issuecomment-405123769见https://github.com/microsoft/vscode-node-debug/issues/1#issuecomment-405123769
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.