That DEL key thing...

How to make DEL delete characters "to the right"

By default, on NetBSD console DEL deletes previous [left to ze cursor] characters, same as the BackSpace. In case of PS/2 keyboards DEL and BackSpace ain't even differeniated, producing same control character (^?)


It results from prehistorical mess of interpreting keys[1], even tho it works on X11 the "normal" way (DEL removes after, BS before cursor)


Solution is pretty simple, as it's just 'bout creating this one-liner:

bind ^? ed-delete-next-char

as ~/.editrc and relogging. To make this behaviour default for new users, copy it to /etc/skel and use "-k /etc/skel" with useradd(8)


For PS/2 keyboards you got to separate DEL from BackSpace as well, by adding

setvar wskbd map+ \"keycode\ 14\ =\ Cmd_ResetEmul\ Backspace\ Delete\"

to /etc/wscons.conf and restarting wscons or simply rebooting.


Troubleshooting

After applying .editrc, very likely both keys will delete on right when over a ssh session from Linux host (since BS on Linux generates "^?", not "^H" like on NetBSD).
Solution (that doesn't break anything else, to my tests) is to remap Backspace on Linux host to "^H"; In case of xfce4 terminal it's Edit > Preferences > Compability and setting "Backspace generates" to "Control-H"




ref: https://mail-index.netbsd.org/netbsd-users/2025/03/08/msg032411.html

[1] https://mail-index.netbsd.org/netbsd-users/2025/03/08/msg032407.html (Recommended to check entire thread)>

pl [at] szwajn [dot] net

Return

18/08/2025

Mod. 18/08/2025