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 interrupt signal handling during shell.RunInteractiveShell() #2613

Conversation

Andriamanitra
Copy link
Contributor

closes #2612

@Andriamanitra
Copy link
Contributor Author

Andriamanitra commented Oct 31, 2022

This also slightly changes Ctrl-C behavior during the "Press enter to continue" prompt:

- Pressing Ctrl-C does not immediately interrupt the process
- The program will close after the user presses enter if Ctrl-C was pressed.
+ Pressing Ctrl-C does not interrupt the process
+ The program returns to the editor as normal after user presses enter.

I do not think this is an issue so I didn't bother with trying to find a workaround. Ctrl-C keybinding still works normally once the editor is restored.

EDIT: Actually this also affects users trying to kill micro from outside with SIGINT (for example kill -INT micro). I tried adding signal.Reset(os.Interrupt) but unfortunately that does not work due to a bug in golang: golang/go#46321

@Andriamanitra Andriamanitra marked this pull request as draft October 31, 2022 09:59
@Andriamanitra
Copy link
Contributor Author

As explained in the issue comments I don't think this approach will work without messing up SIGINT handling ☹️

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.

Keyboard interrupt (SIGINT) during a shell.RunInteractiveShell call from a plugin stops the editor itself
1 participant