When I try to use tab-completion in bash for a file glob pattern starting with either ? or *, I get the list of completion options as intended, but then my command prompt is modified to escape the glob special character.
For example:
$ ls *.txt # tab-complete instead of enter
bar.txt fib.txt foo.txt
$ ls \*.txt # now my '*' is escaped
And:
$ ls ???.txt # tab-complete
bar.txt fib.txt foo.txt
$ ls \?\?\?.txt # please stop
How do I get it to stop escaping the special characters when I trigger tab-completion?
This doesn't happen when the * or ? special character is not at the start of the pattern for completion:
$ ls f*.txt # tab-complete
fib.txt foo.txt
$ ls f*.txt # my prompt doesn't change. This is what I want.
This problem seems very similar to:
- bash tabbing for autocompletion escapes $
- https://askubuntu.com/questions/70750/how-to-get-bash-to-stop-escaping-during-tab-completion
None of the solutions seem to address my problem, though.
Some info about my setup:
- My
~/.inputrccontains (pretty much exclusively)set editing-mode viandset show-all-if-unmodified on. - I'm using
bashversion 5.0.17(1)-release (x86_64-pc-linux-gnu). - I uninstalled
bash-completionbecause it was causing me another problem with tab-completion. (Tab-completion changed my prompt to use the first match rather than showing me the options. I got the idea to uninstall it from https://unix.stackexchange.com/a/278449/439902 .)