Catch Windows terminal closing on running process

前端 未结 3 1339
旧巷少年郎
旧巷少年郎 2020-12-20 03:26

In a command prompt window, I have a running process. While the process is still executing, I click the (red) \'X\' in the corner of the command prompt window. The command p

3条回答
  •  天命终不由人
    2020-12-20 04:03

    "SIGHUP"... tested on Windows 8.1 pro + Node.js 0.10.24 works fine..

    process.on('SIGHUP', function(){
        //Your code goes here.
    });
    

提交回复
热议问题