summaryrefslogtreecommitdiffstats
path: root/curs_lib.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2020-02-22 14:15:50 -0800
committerKevin McCarthy <kevin@8t8.us>2020-02-29 20:30:56 -0800
commit92322ccfaf469a262e04ea1765e4ce1c3a1a0367 (patch)
tree8f4f03b910f599bb27996bc037ab0eafc1cd860b /curs_lib.c
parentd800ede1080c389a7293ccf4ad5d4b5c443f0995 (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.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/curs_lib.c b/curs_lib.c
index a11dc1bc..12db97f8 100644
--- a/curs_lib.c
+++ b/curs_lib.c
@@ -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);