Fix SIGINT killing micro when saving with sudo by dmaluka · Pull Request #3495 · micro-editor/micro (original) (raw)

added 2 commits

October 6, 2024 17:08

@dmaluka

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 micro-editor#2612 for RunInteractiveShell() which was fixed by micro-editor#3357. So fix it the same way as in micro-editor#3357.

@dmaluka

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.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})