After a recent update of my Arch Linux, I faced an issue in bash. Ctrl+Left/Right didn’t work. Instead, bash just showed “;5D;5C;5A;5B;5D;5C”, etc.
Hopefully, I use git to keep track of my /etc directory, thus I was able to see the diff of the update. The cause of the issue is a change in /etc/profile, specifically, removing the line:
INPUTRC="/etc/inputrc"
As we may see from man bash, “If that variable [INPUTRC] is unset, the default is ~/.inputrc.” Yes, I didn’t set the variable in my .bashrc, and I didn’t have the .inputrc file. So, the solution is pretty obvious: create your own .inputrc file. Mine is below:
1234567
$include /etc/inputrc
# faster completion
set show-all-if-ambiguous on
"\e[A": history-search-backward
"\e[B": history-search-forward