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

fix: ctrl+c does not end the child process #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wll8
Copy link

@wll8 wll8 commented Jun 17, 2022

See: coderaiser/cloudcmd#190

this.on('kill', (code) => {
    // Can only end the first process
    // child.kill(code);

    // Can end subprocess, but at the expense of `code`
    import('fkill').then(fkill => fkill.default(child.pid, {
        force: true,
    })).catch(err => {
        console.log(`Process has been terminated, or other errors.`)
    });
});

@coderaiser
Copy link
Owner

Would be great to have test for this using 📼Supertape

@wll8
Copy link
Author

wll8 commented Jun 17, 2022

You add this test harness in this repository and then I add test cases?

@coderaiser
Copy link
Owner

You can install it and use just like in restafary and other packages

@coderaiser
Copy link
Owner

I'm preparing Cloud Commander to ESM, so we can use regular import instead of dynamic coderaiser/cloudcmd@9f4a23e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants