[SOLVED] How to enable "reverse-search-history" in opnsense shell?

Started by TheLinuxGuy, January 19, 2021, 04:36:06 AM

Previous topic - Next topic
I miss the ability to do CTRL + R and regex search past commands in linux terminal.

It seems like opnsense implements shell at /usr/local/sbin/opnsense-shell << is it possible to add the ability to CTRL+R regex search in this shell?

Item 2 in this guide shows a GIF of what I mean by reverse-i-search: https://thomasweng.com/terminal_tips/

Thanks

You can change the root shell away from csh to something else, but opnsense-shell is just a menu wrapper and selects csh on option 8 in any case.


Cheers,
Franco


CTRL + R is AFAIK a feature of GNU readline and not a feature of a shell. Since zsh does not build on readline, you can use that if you install that or you can use a readline based shell like bash if you install it.

Quote from: fabian on January 19, 2021, 08:00:43 PM
CTRL + R is AFAIK a feature of GNU readline and not a feature of a shell. Since zsh does not build on readline, you can use that if you install that or you can use a readline based shell like bash if you install it.

Thanks for the pointer.

I went into the $SHELL file that executes for opnsense and edited the $SHELL_CMD= to the bash path. Now when I hit option 8 in menu it takes me to my preferred shell which does have the reverse search.

Mind you, this will be overwritten with the next update. I'm not against something more permanent but the need was never there before so it is what it is right now.


Cheers,
Franco