Assume one has the following alias in your .bashrc
:
alias docker='sudo docker'
then try to autocomplete docker run -v /tmp/test:/foo …
in a bash terminal, starting from docker run -v /tmp
| → due to the presence of sudo
in the alias, one gets the following distracting behavior:
$ docker run -v /tmpTAB $ docker run -v /tmp[sudo] password for user:
and at that point, it is almost impossible to further edit the command line, apart from doing Ctrl+C and restarting.
Are there solutions to overcome that behavior? namely, keep the sudo
implied in the alias, but avoid the password prompt when we are just expecting some regular autocompletion.
A solution that is independent of the alias
feature would be nice (given the issue presented here also arises when typing any $ sudo command …
directly).