With `set -o vi` in .profile when I login I can see that the option should be set: $ set -o | grep -w vi vi on but it is not functional - ESC-K does nothing. Explicitly setting it again on the commandline works - ESC-K recalls the previous line for editing. Main as of c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf
This is caused by the bind commands that exist by default in .~/shrc, e.g. # csh like history on arrow up and down bind ^[[A ed-search-prev-history bind ^[[B ed-search-next-history With these commands commented out `set -o vi` in .profile functions as expected. This is the same sort of issue described in PR215958. If I call histedit() unconditionally in bindcmd the problem is avoided. Perhaps individual bind commands undo the effect of `el_set(el, EL_EDITOR, "vi")`?
Thanks for this PR - this has been annoying me for quite a while but I never came around to actually open a PR on it. With the "bind" hint, what I came up was "would it work if I move the 'set -o vi' command to the end of '.shrc'" - and lo and behold, it works :-)