The behavior of SIGINT (typically generated by Ctrl-C in the terminal)
is not documented.

It currently asks whether to exit, with MUTT_YES as the default:

/* this function is called when the user presses the abort key */
void mutt_query_exit (void)
{
  mutt_flushinp ();
  curs_set (1);
  if (Timeout)
    mutt_getch_timeout (-1); /* restore blocking operation */
  if (mutt_yesorno (_("Exit Mutt?"), MUTT_YES) == MUTT_YES)
[...]

Why doesn't it use "query_quadoption (OPT_QUIT," like <quit> and <exit>?

This would be safer in case one types Ctrl-C + <Return> by mistake.
I often do Shift-C + <Return> (very quickly), but I sometimes mistype
Shift-C as Ctrl-C, hence the issue.

      case OP_QUIT:
[...]
        if (query_quadoption (OPT_QUIT, _("Quit Mutt?")) == MUTT_YES)
[...]
      case OP_EXIT:
[...]
        if ((!in_pager)
            && (query_quadoption (OPT_QUIT,
                                  _("Exit Mutt without saving?")) == MUTT_YES))

BTW, as mutt_query_exit() doesn't save, the message should be
"Exit Mutt without saving?" like with <exit>, IMHO. Or even
either "Exit Mutt without closing the mailbox?" or
"Exit Mutt without cleanup?", since <exit> does

          if (Context)
          {
            mx_fastclose_mailbox (Context);
            FREE (&Context);
          }

but mutt_query_exit() doesn't.

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to