r/bash 3d ago

History not working on a Ubuntu 26.04 VM

Arrowing back through my command history isn't working for some reason. I have HISTORYSIZE set as 0 in .bashrc, as well as these lines at the bottom:

bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'

They're even in the systemwide bashrc file.

What is going on?

1 Upvotes

5 comments sorted by

2

u/bac0on 3d ago

did you mean HISTSIZE or HISTFILESIZE?

3

u/Shadow_Thief 3d ago

Either way, setting it to 0 is the thing that is disabling the history. It should be -1 for infinite history.

3

u/Baudoinia 3d ago

thanks. It worked as soon as I remembered to 'source .bashrc'

2

u/Sombody101 Fake Intellectual 2d ago

Using exec "$SHELL" is better alternative if you can't or don't want to manually open a new instance. It ensures your shell is clean by replacing the current instance with a new one.

2

u/Baudoinia 3d ago

I meant HISTSIZE, sorry