Another what the heck moment in Fedora 43. In Gnome-terminal (only, not xterm), hitting 'Delete' in vim insert mode no longer deletes characters to the left of the cursor, only characters to the right. Delete is generating ^? in both gnome-terminal and xterm, and Delete works to delete characters in vim in g-t on the ':' command prompt.

Whatever vim / gnome-terminal combined stupidity this is, I want it gone. Now.

Well I have an answer to my vim and gnome-terminal thing and the answer is 'set noxtermcodes'. The other answer is that both gnome-terminal and vim have what I think are bugs that collude to allow this situation to happen. You can argue about exactly whose fault this was, but that's not really productive.

Well I guess there is a workaround in gnome-terminal by changing what it generates for 'Delete' (the key) to 'escape sequence'. What a mess.

I thought I could write a nice simple techblog entry about my gnome-terminal issue in vim and now I am opening up https://www.tuhs.org/ to look at 4.2 BSD manual pages.
The Unix Heritage Society

The Unix Heritage Society

@cks

Let me guess: historical termcap. (-:

Might be Joy+Horton #vi, but my first guess is #termcap.

The way that termcap, and even terminfo, handle switchable stuff like this is truly terrible, because it simply does not fit their model. They're poor on input sequences anyway.

#FreeBSD still uses termcap(5), pretty much the only operating system left that does, and its manual page discusses how one might want to be compatible with AT&T #Unix S5R2 in the future.

https://man.freebsd.org/cgi/man.cgi?query=termcap&sektion=5

termcap(5)

@JdeBP It was indeed historical termcap. I was curious if I could nail down where 'kd' for 'delete key sends this' was introduced, and it turns out to be 4.3 BSD (it doesn't seem to have been in 4.2). I don't know where the terminfo equivalent (kdch1) was introduced, but it may have been there more or less from the start of terminfo.