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 SIGINT killing micro when saving with sudo #3495

Merged
merged 2 commits into from
Oct 12, 2024

Conversation

dmaluka
Copy link
Collaborator

@dmaluka dmaluka commented Oct 6, 2024

When we are saving a file with sudo, if we interrupt sudo via Ctrl-c, it doesn't just kill sudo, it kills micro itself.

The cause is the same as the similar issue #2612 for RunInteractiveShell() which was fixed by #3357. So fix it the same way as in #3357.

Also on top of that, fix the lack of error reporting when saving with sudo fails.

When we are saving a file with sudo, if we interrupt sudo via Ctrl-c,
it doesn't just kill sudo, it kills micro itself.

The cause is the same as in the issue zyedidia#2612 for RunInteractiveShell()
which was fixed by zyedidia#3357. So fix it the same way as in zyedidia#3357.
When saving a file with sudo fails (e.g. if we set `sucmd` to a
non-existent binary, e.g. `set sucmd aaa`), we erroneously return
success instead of the error, as a result we report to the user that
that the file has been successfully saved. Fix it.
@JoeKar JoeKar merged commit d60413f into zyedidia:master Oct 12, 2024
6 checks passed
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