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

Jim via Mutt-dev <[email protected]> Sun, 2 Aug 2026 13:29:29 -0300
Newsgroups gmane.mail.mutt.devel
Message-ID <[email protected]>
On Sun, Aug  2, 2026 at 05:13 (-0400), Thomas Dickey wrote:

> On Sat, Aug 01, 2026 at 09:53:37PM -0300, Jim via Mutt-dev wrote:
>> On Sat, Aug  1, 2026 at 21:47 (-0300), Jim wrote:

>>> On Sat, Aug  1, 2026 at 18:34 (-0400), Kurt Hackenberg wrote:

>>>> On Sat, Aug 01, 2026 at 18:05 -0300, Jim via Mutt-dev wrote:

>>>>>> Moreover, Jim also said that the Delete key of
>>>>>> his keyboard sends ^H (instead of the usual escape sequence).

>>>>> Or so says my shell when I type Ctrl-V <delete key>.

>>>> That's with X and a terminal emulator?

>>> Yes.  Specifically, urxvt.  Same in xterm.

>>>> That is peculiar. I would look into why that ^H happens.  Something
>>>> strange in X keyboard input, I guess.  Do you configure that keyboard
>>>> input in any way, maybe through xmodmap?

>>> No.  A few messages ago (I didn't realize my ideas about "delete" meani=
ng
>>> "delete backwards" were going to take on a life of their own) I mention=
ed
>>> that back in 2004 I used to swap backspace and delete with xmodmap, but
>>> since then I haven't had to do it.  I may have known at the time what
>>> changed, but if I did, that memory is long gone.

>>>> What does xev say about the Delete key?

>>> It says

>>> KeyPress event, serial 33, synthetic NO, window 0x5200001,
>>> root 0x6ab, subw 0x0, time 607437571, (105,127), root:(286,252),
>>> 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

>>> which makes a certain amount of sense (to me, anyway): the "delete" key
>>> sends the "Delete" keysym and XLookupString turns that into the ASCII D=
EL
>>> character.


>>> Bonus information:

>>> My termlib entry says  kdch1=3D\E[3~.

>>> Interestingly (or not) with xfce4-terminal, at my shell prompt,
>>> Ctrl-V <delete>
>>> outputs <Esc>[3~, and kdch1 is the same \E[3~ there.

>> "Mystery" (partially?) solved.  I see that (presumably since 2004 or so)=
 I
>> have X resources for xterm
>> XTerm*backspacekey:	\177
>> XTerm*deletekey:	\010

> those aren't recognized by xterm (see manpage)

Looking in my X resources file, I see

XTerm.vt100.translations: #override \
                <Key>BackSpace: string(\177) \n\
                <Key>Delete: string(\010)

(which I didn't notice when I quickly looked).

Some people might wonder about the ones I mentioned above; the comment
in my file is revealing:

! Ironically, this works in rxvt and aterm, but not xterm!
XTerm*backspacekey: \177
XTerm*deletekey: \010

The "mystery" is possible more solved now.

                                Jim