Re: [PATCH] Remove ncurses meta() call.
"Kevin J. McCarthy" <[email protected]> Fri, 26 Jun 2026 13:20:46 +0800
| Newsgroups | gmane.mail.mutt.devel |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Jun 26, 2026 at 12:15:49AM -0400, Kurt Hackenberg wrote: >On Thu, Jun 25, 2026 at 18:30 +0800, Kevin J. McCarthy wrote: > >>Ah, I figured out what foot is doing with meta enabled, (and xterm >>without any metaSendsEscape settings). >> >>If I type Alt-p, the terminal converts 'p', 0x70, to 0xF0, by >>flipping the high bit. But then it encodes that in utf-8 and sends >>that to mutt. So mutt receives 0xC3 0xB0 in two getch() calls. >> >>It's a mess. > >That sounds like a bug in foot, or maybe a misconfiguration. It should >do at most one of those things, not both. xterm does the same thing, if you remove all its configuration settings and run it in a utf-8 locale: converting Alt-p to 0xF0 and then utf-8 encoding and sending that to mutt as two bytes. It seems xterm relies on the "xterm.vt100.metaSendsEscape: true" setting, which is ubiquitous, to do Esc prefixing. The presence of the meta() call doesn't affect xterm's behavior - it relies solely on the presence of that config to do the Esc-prefixing or not. foot, on the other hand, does Esc-prefixing out of the box. It is affected by the meta() call though, which seems to switch foot into the same mode that xterm has by default. So I don't think that I have enough knowledge or any standing to suggest to foot they are doing the wrong thing. :") It's just a matter of how they've interpreted and implemented smm/rmm. >Anyway, I agree that it's probably best to remove Mutt's call to the >ncurses function meta(). > >>I'm actually pondering pushing this commit to stable and releasing >>it with 2.4.1. Feedback? > >Ehh...maybe try foot again? It really shouldn't do what you describe above. I appreciate the note of caution, but at this point, I think it's worth the risk. foot has an increasing user base, and the Debian bug(s) have been around for a year. I wish I'd heard about the problem earlier. In addition to xterm and foot, I've also tested ghostty, alacritty, kitty, and gnome-terminal. Those last four seem unaffected by the change. If there are other terminals anyone can suggest (that don't involve too many dependencies) I'll be glad to try them out too. -- 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----- iQIzBAEBCgAdFiEEiXWpszqjeRA4XFMIre92hIAxa9oFAmo+DC4ACgkQre92hIAx a9pTUhAArXmYEOFAOTUsjTw2Bh5c1uBr6C4D/GvVMr4dSS3suFeMA1cka2RKf/sz 9j+PiGRJssq0ifEsgjgEQdHsdNV5mfSjJE8mroAedB0xtb/6A0sScYaQJwCiOp4f AgnOuwc6LlTlEwU7b3Sm9i40bbxrLeU4Qf5j9KEisLfKFH04kW6ZK+jGJTP3c7JH ytEwdz5s26jC/Igd9vVf+TCEuqfFK62LhZlBclPKnK+KlU/Xxz5724em4lHSh2Xq 84d5Y701HsyVSRSyPbSWSzxLPyMDM8OaIXJfx+sj4U5s+x0cWvH5e6NV1PY2IOjJ hJIav2jIvB10cjdlb/2ivnCTATwFVw/JH9QF6EJqe3gI4LEY3XXGMoxfXPcBiQeM y+gn63PiA6Uggipv8nWY2MWvKu2g2Xq3RBC5rEufbNncR5evunEBew/TkNtlU5E0 UqAhWSgOIUXtyGR90r3iBr6Uayfi35DVoUmqPHvx7YCTAE9wNwEWMZ/DBKwnXRQn y2bQq5HMxDo4TIUzNQS5612uWKQHuIJBy8cxzU7ozknvYAFTkveskP5lidEER8gB D38BrC5sBV31vGu9K6NNpbOZ+raxSAg9O2wjXkOpZlMNpd89Ukf77cg0dPNnKUNM 7qJDh1CYqUYgBg7zFsSWmVH+kQK3ipm9+3MCR+30ySCbCxFAyGM= =GRDD -----END PGP SIGNATURE-----