summaryrefslogtreecommitdiffstats
path: root/curs_main.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_main.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_main.c')
-rw-r--r--curs_main.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/curs_main.c b/curs_main.c
index e6972618..32a69f60 100644
--- a/curs_main.c
+++ b/curs_main.c
@@ -1052,6 +1052,18 @@ int mutt_index_menu (void)
{
int check;
+ if (mutt_background_has_backgrounded () &&
+ option (OPTBACKGROUNDCONFIRMQUIT) &&
+ /* L10N:
+ Prompt when trying to quit Mutt while there are backgrounded
+ compose sessions in process.
+ */
+ mutt_yesorno (_("There are $background_edit sessions. Really quit Mutt?"),
+ MUTT_NO) == MUTT_NO)
+ {
+ break;
+ }
+
oldcount = Context ? Context->msgcount : 0;
if (!Context || (check = mx_close_mailbox (Context, &index_hint)) == 0)
@@ -1468,6 +1480,14 @@ int mutt_index_menu (void)
&& (query_quadoption (OPT_QUIT,
_("Exit Mutt without saving?")) == MUTT_YES))
{
+ if (mutt_background_has_backgrounded () &&
+ option (OPTBACKGROUNDCONFIRMQUIT) &&
+ mutt_yesorno (_("There are $background_edit sessions. Really quit Mutt?"),
+ MUTT_NO) == MUTT_NO)
+ {
+ break;
+ }
+
if (Context)
{
mx_fastclose_mailbox (Context);