Re: [PATCH] Change <delete> to delete forward in the editor menu.
Valentin Nechayev <[email protected]> Mon, 27 Jul 2026 11:00:42 +0300
| Newsgroups | gmane.mail.mutt.devel |
|---|---|
| Message-ID | <[email protected]> |
At Mon, 27 Jul 2026 02:25:34 +0200, Vincent Lefevre wrote: > U+0008 BACKSPACE > U+007F DELETE > > At some point (possibly introduced by Microsoft), the BackSpace key > was sending the character of code 8 and the Delete key was sending > the character of code 127 (0x7f), Iʼm trying here to jot down a long and somehow stodgy version of the previous comment. Microsoft, saying again, was not propeller of this manner. Discrepancy between two manners: 1) delete-backward = 0x08, delete-forward = 0x7F; 2) delete-backward = 0x7F, delete-forward = a sequence, e.g. Esc [3~ originates in much earlier systems. As a quickly reachable source, look at FreeBSD/OpenBSD/NetBSD /etc/termcap (handy because a single text file), which terminals have assignment kb=^H and which have kb=^? (\177 there). The first list includes names like "diablo 1640", "dtc300s", "nec spinwriter"... most of them were devised much before Gates & Co. ever concieved something with IBM PC. (Notice terminfo: kb -> kbs, kD -> kdch1.) Early Unix development was primarily tied to DEC and its terminals of VT100 line (VT100, VT102, VT220, etc.) Even in the earliest VT100 there were two separate "Backspace" and "Delete" keys. But, mapping was different. What I could find from different modes of Internet search is that: 1) VT100 had fixed Backspace -> ^H, Delete -> ^?; 2) VT220 (some flavors) had fixed Backspace -> ^?, Delete -> Esc [~3; pictures of physical VT220 keyboard (trivially searchable) show two keys, though <https://vt100.net/docs/vt220-rm/chapter3.html#S3.2.1.1> shows only one near alphanumeric block, and other one as F12; 3) VT340 introduced DECBKM option that allowed switching what Backspace generated, between ^H and ^?; itʼs still open whether the option affected Delete key. I presume there were physical variations of terminals, and modifications of terminals firmware adjusted for a single mode or for the switch option; as DEC history from its authoritatives is unavailable, we can rely only on enthusiastsʼ data. What is undoubtful that DEC had already reified and expanded this mess, in addition to other vendors, and that they had already supported two different keys. The contention lasts for decades, having proponents of each; for example, FreeBSD console still keeps kb=^H, kD=^?. The second camp (kb=^?) now prevails, with famous representatives like Linux console, xterm, screen. A huge argument in favor of kb=^? is default Emacs setup where ^H is used as a command introducer, so, it was not Backspace on a system where Stallman incepted Emacs. Emacs community seems having been an influencing pusher of this mapping. When I used Emacs on FreeBSD, I had to remap function of this ^H to another key (normally, F1) before I could even look into built-in help. I guess we can stably speak about the win of the second camp as the default one. Nevertheless, the ASCII code names seem definitely having origin in the first one. What Jim seemed to introduce to this discussion is what function (delete-backward or delete-forward) is to be mapped to what stands for "Delete" key of a keyboard. But he seemingly relies on his own experience. With pictures of two keys on even VT100 I would not support his deliberation. Currently we have ISO 9995 and ANSI INCITS 154-1988 which define "Backspace" (at positions E14 and possibly E13, according to the ISO 9995 grid) and "Delete" (D30 and A53). The grid can be seen at <https://en.wikipedia.org/wiki/ISO/IEC_9995>. Yep, this is what was devised by IBM (but the 101-key AT keyboard was designed as a cut-down version of 3270 terminal keyboard, so, all this from their own requirements). And, both this standards, AFAIK (I canʼt say for all 100% because have not got original texts) define exactly these two names "Backspace" and "Delete". Often Backspace is not written as a word, but simply a variant of left arrow (⇐). Jim mentioned his laptop. Mine has nearly the same: one marked "<- backspace" right to "=" (ok, regular), then a smaller "delete" just up to it (and this is how Acer designed this particular series), and, finally, combined ". del" at the numeric keypad. As soon as nowadays the overwhelming most of industrial vendors follow the mentioned standards (as a grounding of their designs, if not literally following), we have no choice but to accept the naming that delete-backward is called "Backspace" and delete-forward is "Delete". > Apple keyboards only have a Delete key, whose effect is to delete > backward (like the BackSpace key on other keyboards): > > https://en.wikipedia.org/wiki/Apple_keyboards Apple, definitely, is an outlier here. Its market share is large enough to take into account but it canʼt fully overturn standards. > The naming is more consistent, but the absence of a key to delete > forward is less practical. It exists at their larger keyboards. > With Xorg, the BackSpace key still sends the character of code 8 > and the Delete key sends the the character of code 0x7f, as given > by XLookupString (seen with xev, for instance). However, I suspect > that XLookupString is mostly ignored by the applications, in favor > of the keysym. It seems the first camp legacy. > BTW, I've found in my archives: > > https://aterm.sourceforge.net/keyboard.html > "Consistent BackSpace and Delete Configuration" It is a good explanation for Linux case. I still has doubts for the historical part, due to explained above for VTxxx version mess, but it doesnʼt change the practical part of the explanation. To sum up for the Mutt specifics: as Mutt already has got OP_EDITOR_BACKSPACE and OP_EDITOR_DELETE_CHAR internally, the terms are modern, so, <delete> should map to OP_EDITOR_DELETE_CHAR. (But as soon as I have never really used the builtin editor, preferring vim... I humbly concede to the, likely, tiny camp of its real users.) -netch-