chew socks
chew socks

Reputation: 1446

bash enable autocomplete for PATH names

In bash, if I were to type which pyth<tab> it would autocomplete to which python. I have my own program, limitcpu, and if I type limitcpu pyth<tab> nothing happens.

Tab completion still works for files where I provide the path, but I would like it to work with files (programs) in the PATH environment variable as it does with which.

Upvotes: 0

Views: 1874

Answers (1)

chew socks
chew socks

Reputation: 1446

The bash configuration option complete -c <list of commands> will allow each command in <list of commands> to autocomplete with other commands.

In this case, put complete -c limitcpu in ~/.bashrc or any other place it can be sourced.

Upvotes: 2

Related Questions