It often happens to me that bash disables auto completion for certain commands. This forces me to add random symbol to name of command, use autocompletion, and than fix the command name. This is rather annoying. For example:
# I type:
openvpn s<tab>
# Nothing happens, so I add x
openvpnx s<tab>
# Now this expands to
openvpnx somepath
# Same with ./configure or many other commands...
Is there a way to disable the disabling so that auto-completion ALWAYS works?
Best Answer
Listing completions
You can see what Bash/Readline uses for completing a command using
complete -p command
, e.g., if I runcomplete -p openvpn
, I getThis shows that Readline used by my shell doesn’t have any specific completion for the
openvpn
command so it defaults to the traditional form of completion, i.e., filenames.Another example (to demonstrate a defined completion):
This indicates that a function named
_filedir_xspec
is used to provide completions for thedillo
command.Removing completions
To remove a defined completion, use the
-r
option with thecomplete
builtin: