Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electron process doesn't exit if pseudoterminal isn't fully killed before app is quit #733

Open
TheLazySquid opened this issue Nov 30, 2024 · 0 comments · May be fixed by #734
Open

Electron process doesn't exit if pseudoterminal isn't fully killed before app is quit #733

TheLazySquid opened this issue Nov 30, 2024 · 0 comments · May be fixed by #734
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@TheLazySquid
Copy link

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);
});
@TheLazySquid TheLazySquid linked a pull request Nov 30, 2024 that will close this issue
@Tyriar Tyriar added the bug Issue identified by VS Code Team member as probable bug label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants