Vi mode within BusyBox shell couldn't be enabled

Hi,

It seems there is some problem with enabling vi mode within BusyBorx shell which is comming with OpenWRT.
Does anybody know how to fix this?

root@turris:~# set -o |grep vi
vi off
root@turris:~# set -o vi
root@turris:~# set -o |grep vi
vi off
root@turris:~#

Only vi mode is affected, others can be turned on/off normally using -o and +o.
I just found one old communication about this on tinycorelinux.com and they are talking that it should be fixed in BusyBox 1.16.1. But it’s not even we are already on BusyBox v1.23.2 (2016-09-05 13:26:40 CEST).
http://forum.tinycorelinux.net/index.php?topic=4909.0

Thanks for ANY hints. know it’s not that hot like other topics here, but I really don’t like this emacs mode and arrow keys. :slight_smile:

1 Like

well so far it seems this is not fully resolved within ash shell built in in BusyBox… so there is no official fix for this
the easiest way how to “fix” this is to switch to bash which is part of current turris OS, so need to patch/upgrade anything
in bash the vi mode is automatically enabled (if not, you can enable it by “set -o vi” or put it to .profile)

this can be done by changing default login shell for root in /etc/passwd (remove or hash old and add new with bash):

#root@turris:~# grep root /etc/passwd
root:x:0:0:root:/root:/bin/bash
#root@turris:~#

or another way is to start bash within default login shell ash, you can do it in .profile

#root@turris:~# grep bash .profile
exec /bin/bash

by this way the bash will be started without any setting which are in your .profile file, you can add these settings into ~/.bashrc, or you need to create your own and load it within bash (e.g. .profile.bash) in that case it will be:

#root@turris:~# grep bash .profile
exec /bin/bash -rcfile ~/.profile.bash

1 Like