OS: Windows 10
Electron Version: 33.2.1
Node.js Version: 22.11.0
Node-pty Version: 1.1.0-beta27
Issue Description
If a pseudoterminal is created and the electron app is quit before it is fully killed, the process won't fully exit. From some testing it looks like the electron process still has conhost.exe and cmd.exe as children, so the issue might be that they aren't being shut down in time before the main node.js process is killed.
Reproduction
const { app } = require("electron");
const { spawn } = require("node-pty");
app.whenReady().then(() => {
let pty = spawn("cmd.exe");
// process doesn't exit
setTimeout(() => {
pty.kill();
app.quit();
}, 1000);
// process exits normally
// pty.kill();
// setTimeout(() => {
// app.quit();
// }, 1000);
});