fix: 关闭终端启动QQ

This commit is contained in:
bietiaop committed 2025-02-02 15:34:53 +08:00
1 parent 311dcd5142
commit 50e3f8c9a2
2 files changed
+48 -2

No files matched your search

+10 -2
View File
@@ -89,7 +89,11 @@ class TerminalManager {
instance.sockets.delete(ws);
if (instance.sockets.size === 0 && !instance.isClosing) {
instance.isClosing = true;
instance.pty.kill();
if (os.platform() === 'win32') {
process.kill(instance.pty.pid);
} else {
instance.pty.kill();
}
}
});
} catch (err) {
@@ -145,7 +149,11 @@ class TerminalManager {
if (instance) {
if (!instance.isClosing) {
instance.isClosing = true;
instance.pty.kill();
if (os.platform() === 'win32') {
process.kill(instance.pty.pid);
} else {
instance.pty.kill();
}
}
instance.sockets.forEach((ws) => ws.close());
this.terminals.delete(id);