The default .shrc in a fresh FreeBSD install contains the command
set -o vi (which is commented out). Activating this and starting a new shell leads to unstable bevaviour when editing commands – neither standard movement commands nor vi commands work reliably. But when executing set -o vi manually, it works as intended. Also, executing set -o right after logging in has the same effect: It shows the vi mode being active, and afterwards, vi mode does work. What could be the problem here?