提交 00374069 编写于 作者: D Daniel Imms

Reorganize terminal termination logic

Fixes #31367
上级 129de97e
......@@ -56,14 +56,17 @@ function queueProcessExit() {
clearTimeout(closeTimeout);
}
closeTimeout = setTimeout(function () {
ptyProcess.kill();
if (process.platform === 'win32') {
// Forcefully kill the entire process tree under the shell process
// on Windows as ptyProcess.kill can leave some lingering processes.
// See https://github.com/Microsoft/vscode/issues/26807
cp.execFileSync('taskkill.exe', ['/T', '/F', '/PID', ptyProcess.pid.toString()]);
cp.execFile('taskkill.exe', ['/T', '/F', '/PID', ptyProcess.pid.toString()]).on('close', () => {
process.exit(exitCode);
});
} else {
process.exit(exitCode);
}
ptyProcess.kill();
process.exit(exitCode);
}, 250);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册