Bash Completion Settings Not Working as Expected

I am trying to get bash tab completion to work as I would like, but the options do not seem produce the results I would expect. I am using bash 4.2.46 [4.2.46(2)-release (x86_64-redhat-linux-gnu)], which I cannot change or update due to my organization’s restrictions on the system I am using.

The contents of my inputrc are as follows:

# Tab Completion
set show-all-if-ambiguous on
#set show-all-if-unmodified off
set menu-complete-display-prefix on
TAB: menu-complete
"e[z": menu-complete-backward
set mark-directories on
#set mark-simlinked-directories on
set completion-query-items 40
set completion-ignore-case off
set skip-completed-text on

# Current Line Navigation/Editing
"e[1;5C": forward-word
"e[1;5D": backward-word
"e[1;3~": kill-word

# History
"e[A": history-search-backward
"e[B": history-search-forward

# Other Settings
set bell-style visible

Let’s say I have 3 directories in the current working directory, test1, test2, and tes1. With the inputrc provided above, if I type cd t I would expect:

  • First TAB: complete to cd tes (per menu-complete-display-prefix); display the possible matches, because they are ambiguous.
  • Second TAB: begin cycling through the options per menu-complete

What happens:

  • First TAB: Shows all possible matches, begins cycling through per menu complete (completes to cd tes1/)
  • Second TAB: cylces through to cd test1/
  • Third TAB: cycles through to cd test2/
  • Fourth TAB: cycles through to prefix cd tes

If I comment out set show-all-if-ambiguous on and uncomment #set show-all-if-unmodified on, I would expect:

  • First TAB: complete to cd tes
  • Second TAB: Begin cycling through per menu-complete; display all possible matches (not sure on this one, but I think that’s what it’s supposed to do based on the descriptions in man bash)

What happens:

  • First TAB: completes to cd tes
  • Second TAB: begins cycling through per menu-complete (completes to cd tes1/); does NOT display all possible matches
  • Third TAB: cylces through to cd test1/; does NOT display all possible matches
  • Fourth TAB: cycles through to cd test2/; does NOT display all possible matches

Does anyone know what might be causing this? Is it incorrect behavior in my bash version? Is it related to my other inputrc settings?

Note: I also have a windows machine where I am running git bash with bash version 5.2.26(1)-release (x86_64-pc-msys) and the show-all-if-ambiguous setting works exactly as I expect. The show-all-if-unmodified setting doesn’t work quite as I expected, but that may be because I am not properly understanding how it is supposed to work.