1

.inputrc commands vi-cmd-mode-string and vi-ins-mode-string are not working. No prefix is shown at the beginning of the bash prompt. But the input mode is indeed vim (I can switch between command / insert mode).

I'm on macOS Catalina 10.15.1. I've installed bash with brew install bash (also tested brew install --HEAD to compile locally).

My bash version is 5.0.11. Should be enough for vi-ins|cmd-mode-string that is available since bash 4.4 (https://stackoverflow.com/a/32614367/2058840)

bash --version
GNU bash, version 5.0.11(1)-release (x86_64-apple-darwin19.0.0)
Copyright (C) 2019 Free Software Foundation, Inc.

I've also install readline via brew, but this changes nothing.

My .inputrc :

$if Bash
    set editing-mode vi
$endif

$if mode=vi
    set show-mode-in-prompt on
    set vi-cmd-mode-string bbbbb
    set vi-ins-mode-string aaaaa
$endif

What am I missing here? With this bash version, I expect bbbb or aaaa to be shown as the bash prompt prefix.

Guillaume Wuip
  • 343
  • 5
  • 13

1 Answers1

1

Ok. Just found out it's not a problem with the homebrew bash version.

My macOS user config still use the default bash version /bin/bash (bash 3) instead of the homebrew one /usr/local/bin/bash. You can change yours with https://www.howtogeek.com/444596/how-to-change-the-default-shell-to-bash-in-macos-catalina/.

It took me time to understand that because of the bash --version test. This test the version of the first bash accessible in your $PATH. Not the bash used to open your shell.

Guillaume Wuip
  • 343
  • 5
  • 13