提交 5450fbe1 编写于 作者: D Daniel Imms

Don't kill process tree when terminal is killed

Fixes #35492
上级 d86955c7
......@@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as cp from 'child_process';
import * as os from 'os';
import * as path from 'path';
import * as pty from 'node-pty';
......@@ -56,17 +55,8 @@ function queueProcessExit() {
clearTimeout(closeTimeout);
}
closeTimeout = setTimeout(function () {
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.execFile('taskkill.exe', ['/T', '/F', '/PID', ptyProcess.pid.toString()]).on('close', () => {
process.exit(exitCode);
});
} else {
ptyProcess.kill();
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.
先完成此消息的编辑!
想要评论请 注册