Re: [PATCH] Change <delete> to delete forward in the editor menu.

Jim via Mutt-dev <[email protected]> Tue, 28 Jul 2026 22:03:51 -0300
Newsgroups gmane.mail.mutt.devel
Message-ID <[email protected]>
On Tue, Jul 28, 2026 at 23:37 (+0200), Vincent Lefevre wrote:

> On 2026-07-26 22:33:44 -0300, Jim via Mutt-dev wrote:
>> For example, the VT240, a very common terminal in its day had a Delete k=
ey
>> (whose keycap sometimes said "Delete", and sometimes had a little icon o=
n it)
>> just above the return key, and that pressing that key sent the ASCII del=
ete
>> character.

>> See https://www.nf6x.net/wp/wp-content/uploads/2014/01/IMG_2839.jpg for a
>> picture of a version of the keyboard with the icon rather than the word
>> "Delete".

> So, at that time, it appears that "delete" was used for what we
> call "backspace" nowadays.

Well, perhaps a lot of people call "delete" "backspace" nowadays.  Being
stubborn, I still call "delete" "delete" and "backspace" "backspace".  :-)

> The behavior is the same: delete the character on the left of the cursor.

> The name of the associated ASCII code 0x7f ("delete") has not changed,
> though.

Don't say that too loud, it might give someone an idea.


>>>> (Well, with the possible exception of an APL terminal; as you may know,
>>>> in APL backspace didn't delete, because there were some characters
>>>> composed as <char 1><backspace><char 2>.)

>>> IMHO, you are not talking about the usual BackSpace key here,

>> Where are you referring to?  I had talked about two things.

>> In the first one, I was indeed talking about a physical key on a keyboar=
d.

>> In the second one, I was talking about whatever an IBM 2741 terminal did
>> when you pressed the backspace key.  What it didn't do in that situation
>> was delete the character... it moved backward.

> So what was called "backspace key" at that time is not what we call
> "backspace" nowadays.  I suppose that this key was sending the ASCII
> "backspace character" (code 8), not the "delete character" (code 7f).

There you go saying "we" again, as if everyone has this idea that
"backspace" =3D "delete".  (Or is it "delete" =3D "backspace"?)
(Perhaps your "we" refers to a particular set of people whose set
membership function I don't know.)

>>> At some point (possibly introduced by Microsoft),

This was the situation for systems I used well before Microsoft came along,
as it turns out.

>>> the BackSpace key was sending the character of code 8 and the Delete
>>> key was sending the character of code 127 (0x7f),

Which, if you think about it, makes perfect sense.  Sort of like the
(unshifted, uncontrolled) "a" key sending 'a' (i.e., code 97) or the "1"
key sending '1' (code 49).

>>> and on such a system, the character of code 8 was deleting backward and
>>> the the character of code 127 was deleting forward.  But later, this
>>> was assumed to be incorrect,

I'd agree with that being incorrect.  And I bet there are at least 8 other
people still alive who would agree with me.

>>> and nowadays, with most system configurations, the BackSpace key sends
>>> the character of code 0x7f (which was originally the character to
>>> delete backward) and the Delete key sends some special escape sequence.

>> Just to be clear, are you talking about current ("IBM") PC keyboards?

> Yes. But this has been standardized:

> https://en.wikipedia.org/wiki/ISO/IEC_9995

I'll see your ISO and raise you an xkcd: https://m.xkcd.com/927/


>>> 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.

>> On my system XLookupString gives the same character (for the backspace a=
nd
>> delete keys) as listed for the keysym.

> What do you mean?

I interpreted what you wrote to mean is that in some / many cases what
XLookupString tells is different than what the keysym would suggest.

In my case, using xev, pressing the key with the left-pointing arrow gives
me:

KeyPress event, serial 33, synthetic NO, window 0x2e00001,
root 0x6ab, subw 0x0, time 491853741, (98,101), root:(327,274),
state 0x0, keycode 22 (keysym 0xff08, BackSpace), same_screen YES,
XLookupString gives 1 bytes: (08) "
XmbLookupString gives 1 bytes: (08) "
XFilterEvent returns: False

and pressing the key marked "delete" gives me:

KeyPress event, serial 36, synthetic NO, window 0x2e00001,
root 0x6ab, subw 0x0, time 491855878, (98,101), root:(327,274),
state 0x0, keycode 119 (keysym 0xffff, Delete), same_screen YES,
XLookupString gives 1 bytes: (7f) "=7F"
XmbLookupString gives 1 bytes: (7f) "=7F"
XFilterEvent returns: False

So what I meant was that regardless of whether a program looks at the
keysym or the value given by XLookupString, the program would (on my
system) get the same thing.  (Well, at least for anyone who thinks that
"Delete" means the character with code 127, and "BackSpace" means the
character with code 8.  But perhaps some/many/most people don't have that
association (?).)

Cheers.
                                Jim