[CentOS] bash completion in C7

Gordon Messmer gordon.messmer at gmail.com
Wed Aug 29 15:27:06 UTC 2018


On 08/28/2018 11:33 PM, wwp wrote:
>   - it doesn't expand *foo whereas there are *foo-named files in current dir, for instance:
>     # rm *foo
>     will show nothing whereas there's a file barfoo in curdir.

Tab completion finishes a single word, given a string that appears at 
the beginning of a list of candidates.

Wildcard expansion (Ctrl+x, e) will expand a word containing a wildcard 
to multiple words on the command line, usually so that you can remove 
some matches.

Neither will do specifically what you're trying to do, as far as I 
know.  I think it's simply too ambiguous.

>   - completion takes 10 sec to propose me something, I don't have an
>     example right here but I'd prefer no completion instead of a
>     completion that hangs for more than 3 sec.

Some completions can take a while.  For example, tab completing a path 
on a remote system in an scp command, or completing a local path if it's 
matched against command output rather than the filesystem.  IIRC, if you 
run "git diff path/...", the shell will use the output of "git status" 
to determine which paths have changed.

I don't know any way to set an upper limit on completions, and while 
"complete -r <cmd>" is expected to disable programmable completion for a 
single command, I can't actually clear completion for the ssh/scp 
commands on my laptop.  "complete -r" turns off programmable completion 
entirely, in which case you simply have simple local path completion, if 
you'd honestly rather not have potentially slow options.




More information about the CentOS mailing list