-
Notifications
You must be signed in to change notification settings - Fork 353
fix: restore stdin raw mode to off after ctrl-c quit #3395
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
base: master
Are you sure you want to change the base?
Conversation
The CI error depends on the dependency update: |
@qupig would be possible from the nodejs app using web-ext as a dependency to do |
@rpl To be honest, I haven't carefully studied the process stack and architecture of In nodejs process we call But I think the more important problem is that it doesn't should to be cleaned up manually with some kind of callback, doesn't it? After the I'm not sure this changes is the most correct way, but it does work back to normal in my tests. I think it would be nice to have a callback when |
I just looked at the code logic a little again, and it seems that it would be more appropriate to modify it here: web-ext/src/extension-runners/index.js Lines 255 to 260 in b85dbe4
- stdin.pause();
+ stdin.destroy(); I'm not sure what the original |
If you use it as a library, would the noInput option better match your needs? Then web-ext won't capture the stdin. |
Yeah, I tried this, but we lost the shortcut key UPDATE: Sorry I rechecked the code and But still, is it better practice to consider releasing |
So I didn't realize before that I could actually register a callback to clean it up: const extensionRunner = await webExt.cmd.run(/*...*/);
extensionRunner.registerCleanup(() => {
process.stdin.destroy();
}); But I still think this cleanup should be the default behavior unless there are obvious reasons or side effects there. Anyway, thanks for the info you guys provided! If you think this is not necessary to fix it, feel free to close it. |
Further investigation revealed that it wasn't directly related to the I updated the PR and tested that it works correctly for me. Please re-review if this PR should be merged. |
When using
web-ext
via API, after quit viaCtrl-C
, the parent process can no longer respond to any keyboard input.This PR fixes the issue by correctly returning
stdin
to the parent process.This fix is only tested and confirmed in the firefox-desktop version.
The firefox-android process may have similar issue, but I cannot test it at the moment.