Re: [PATCH] Turn off curses meta() mode before exiting.
"Kevin J. McCarthy" <[email protected]> Thu, 25 Jun 2026 09:13:23 +0800
| Newsgroups | gmane.mail.mutt.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Jun 24, 2026 at 04:29:11PM +0200, Vincent Lefevre wrote:
>On 2026-06-24 06:56:51 +0800, Kevin J. McCarthy wrote:
>> On Tue, Jun 23, 2026 at 05:42:58PM -0400, Kurt Hackenberg wrote:
>> > On Mon, Jun 22, 2026 at 13:30 +0800, Kevin J. McCarthy wrote:
>> >
>> > > +/* Before exiting, turn off features enabled in start_curses() that
>> > > + * are not reversed by endwin().
>> > > + */
>> > > +void mutt_curses_cleanup(void)
>> > > +{
>> > > +#if HAVE_META
>> > > + meta(stdscr, FALSE);
>> > > +#endif
>> > > +}
>> >
>> > Shouldn't Mutt only turn off that mode if it was off when Mutt started?
>>
>> I don't know how to check that via curses.
>
>is_meta() is missing for that, and according to the meta(3ncurses)
>man page, there isn't a fixed default. So I would say that changing
>the meta status is incorrect, or it should be controlled by an
>option so that the user would explicitly tell Mutt when to set
>meta to TRUE or FALSE. Moreover, according to the discussion, the
>meta status does not belong to the curses window, but to the terminal.
>So, if a user really needs it, this could be done *outside* of Mutt.
>In short, Mutt does not need to care about it.
>
>BTW, I suppose that meta() applies to the top-level terminal.
>So I'm wondering whether it also clashes with GNU Screen or tmux
>(but perhaps their terminfo settings disable this old feature).
Thanks Vincent.
I'm inclined to remove the meta() call and announce it loudly.
I could add a mutt configuration option, but it would be a little
awkward: curses is initialized before the init files are read because
the init files make color declarations (requiring an initialized
curses).
Yes, I could add a separate post-init call to this, but it seems like a
lot of effort for an old curses feature of dubious value. And, as you
said, if users want it, they can set it in their terminal configuration.
If anyone feels differently let me know, otherwise I'll commit this over
the weekend and close the gitlab ticket.
--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEiXWpszqjeRA4XFMIre92hIAxa9oFAmo8gLMACgkQre92hIAx a9rJMxAAnUePJPsrJ9CYimCHv/AipdIa2W+lndy1Xw/AzKd6Ol6IKQs0D6n9IT2+ V2J8TZDo8bICl+HVGWvBegYnwrYEF0K6I5v32ArYuE0eindHWSZkEY2R+NpKx7f2 kPnNhZZVLr+ownJjBfOxMSHHFxJAMV4omoFeYz1bn2MQ4WN5m2SL8PXhphyJ/e8c 20M3Yj4FDmT5OcvzbnA8i2CEhY6nfJy0/sFDCcwsEN7qi4trKWC80alkNpH3vhCH 6l8PfkmUZupP8rZ0UCPf6ssd6ikVnz1FaJ6tXU2jRvOpvd/nmHAFLQKkONN+qeqh 137Jb9+jOTUtuooqe/VXRZHhY5kaSOKydhDs9Evkc6PRi7eeOl13NUiNHgxq7qRa yTS6L/am68yvdfnbCVIEXokUyOVVJvZUDXDwFhyFftqRxeP9EPoSnC6D05ta0chg wUprLREzXvml+AVsm2Zsjw3yaZWl3xa52eUI+RGcnkQP96IkIuZ0f8kk22zaiz5g cknGZ9IlX6gSfZp9zKuKZXQKq2xTjAuDIWSY4ftDSGnho5isAN6FQJKKC3vbhUD8 aXJTdLPWnXndDXsFNDnAGcWyFz6nFgQNyQB+J85477Wk1vLtUZWVgFeiOXATgRAi 2z/cGEeVCuCEzceSTuvf3lkmYyk4HRcIPUEXPhzvhApbvusRtGw= =O5ce -----END PGP SIGNATURE-----