I understand that OW ships with ash as the default shell. I'd like to enable the up and down arrow keys when searching through my shell history with it. Is this possible?
With bash as the default shell, one can create /root/.inputrc containing the following to achieve this behavior:
Hi!
Has bash a special search history feature? I can't remember atm.
I can use the Up/Down keys to search through my last typed commands.
But this history gets deleted after logout. Which actually not that bad. (security)
To make this history persistent, you need to recompile busybox with that feature enabled.
I too can use the arrow keys... I should have made it more clear that the behavior expected is an autocomplete when using the arrow key. For example, consider this history:
0 pwd
1 cd /root
2 cd /etc/config/
3 vim dhcp
4 htop
If you start typing the cd command and then hit up arrow, it would go to the first instance of a command that started with a literal cd... the behavior you're talking about, and what is out-of-the-box: hitting up arrow after typing cd first would just go through the history, so first would be htop, then vim dhcp, then cd /etc/config
Ash is quite old. I'd say wait until toybox has a shell. My guess is when the shell arrives it will become release 1.0. Then hopefully an option on openwrt to replace busybox. Then toybox will evolve to be very good on small embedded devices ...
@anomeome - Changed my mind... I noticed that if I use make menuconfig to navigate and enable customization, there are tons of defaults that get enabled. Is it sane for me to just edit .config and add those 4 lines you shared to get this?
I tried that with just a few busybox options but when I compare the .config before to the new one just adding those 4 lines from your post above, there are tons of new lines and features introduced. Perhaps I am not doing it correctly?