>Synopsis: ksh(1) vi mode WERASE with 'R' erases instead of reverts
>Category: user
>Environment:
System : OpenBSD 7.9
Details : OpenBSD 7.9 (GENERIC.MP) #4: Tue Jul 14 03:27:06 MDT 2026
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
Architecture: OpenBSD.amd64
Machine : amd64
>Description:
Normally in vi replace mode, ERASE (backspace) reverts replaced
characters to what they were before they were replaced. If ERASE
is used at the position replacement was started, nothing happens
instead. WERASE (^W by default) is only correct in regular
insert mode as it's implemented right now, and will remove (not
revert) characters in both modes. In replace mode, this also
does not check if characters would be removed beyond the
position replacement was started -- ERASE appearantly checks if
the cursor position is exactly equal to where replacement was
started, instead of less than or equal to, which leads to some
nastiness with memory, and eventually a SIGSEGV.
>How-To-Repeat:
$ ksh
$ set -o vi
Type this: a a ^[ R ^W ^H ^H ^H ^H...