bash does not honor ~/.inputrc
under the latest macos
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.6
BuildVersion: 19G73
i am using the latest bash (installed via brew)
$ $SHELL --version
GNU bash, version 5.0.18(1)-release (x86_64-apple-darwin19.5.0)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
and bash is defined as the default shell (chsh -s /usr/local/bin/bash
+ reboot)
$ which $SHELL
/usr/local/bin/bash
$ cat /etc/shells | tail -n 1
/usr/local/bin/bash
to customize bash, i have ~/.inputrc
$ ls -l ~/.inputrc
-rw------- 1 foo staff 1432 Jan 21 2020 /Users/foo/.inputrc
that holds the following
set completion-ignore-case on
"\e[B": history-search-forward
"\e[A": history-search-backward
i used to be able to reverse-search using case-insensitive, but now it stopped working.
even tried to run set completion-ignore-case on
and bind 'set completion-ignore-case on'
directly in the terminal but it did not solve my issue.
- is there a bug in the bash version that i am using?
- how can i tell whether bash honors
~/.inputrc
? - how do you recommend to debug the issue?
Solution 1:
after examining the issue under linux, i realized that the issue is not macos specific.
searching the internet harder, i found the solution
you can't get this feature in BASH at present because this feature hasn't been built yet into
vi or emacs mode
. As I commented abovecompletion-ignore-case
only applies to completion, not toisearch
~10 years after the accepted answer, it seems that it is still the case.
references:
- Find out corresponding escape sequence for a given key combo
- Search for a previous command with the prefix I just typed
- In bash, how do I bind a function key to a command?
Solution 2:
SOLVED! macOS Catalina version: 10.15.7
According to the readline manual, ~/.inputrc
should essentially, auto-initialize by bash.
This didn't initially work for me. What finally worked was adding the bind -f ~/.inputrc
to ~/.bash_profile
. Also, remember to install readline using brew install readline
I also tried without success:
- Upgrading to bash 5 using
brew
- did Not auto-initialize~/.inputrc
- Compiling locally a version of
bash5
usingbrew install --HEAD bash
- did Not work - Adding the bind command to
~/.bashrc
- did not work onbash3
orbash5