diff options
author | Kevin McCarthy <kevin@8t8.us> | 2020-02-22 14:15:50 -0800 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2020-02-29 20:30:56 -0800 |
commit | 92322ccfaf469a262e04ea1765e4ce1c3a1a0367 (patch) | |
tree | 8f4f03b910f599bb27996bc037ab0eafc1cd860b /curs_lib.c | |
parent | d800ede1080c389a7293ccf4ad5d4b5c443f0995 (diff) |
Confirm exiting if background edit processes exist.
This prompt is in addition to the $quit prompt. A bit annoying, but I
believe necessary to combat muscle memory and avoid losing compose
sessions.
Diffstat (limited to 'curs_lib.c')
-rw-r--r-- | curs_lib.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -26,6 +26,7 @@ #include "mutt_curses.h" #include "pager.h" #include "mbyte.h" +#include "background.h" #ifdef USE_INOTIFY #include "monitor.h" #endif @@ -465,8 +466,14 @@ void mutt_query_exit (void) mutt_getch_timeout (-1); /* restore blocking operation */ if (mutt_yesorno (_("Exit Mutt?"), MUTT_YES) == MUTT_YES) { - endwin (); - exit (1); + if (!(mutt_background_has_backgrounded () && + option (OPTBACKGROUNDCONFIRMQUIT) && + mutt_yesorno (_("There are $background_edit sessions. Really quit Mutt?"), + MUTT_NO) == MUTT_NO)) + { + endwin (); + exit (1); + } } mutt_clear_error(); mutt_curs_set (-1); |