In my current zsh behaviour, hitting tab after typing "sudo" just adds a space.
$ sudo ...
What I really want is for the tab to fully expand to the path of the binary it is about to execute when I hit tab, allowing me to see what will be run:
$ /usr/bin/sudo ...
The aim is to protect against the case where the local user on my machine is hacked, an entry added to my $PATH
variable, and 'sudo' runs a malicious program, which would be an easy escalation to root.
=
and press tab after the command, and it will expand the command name into full path. – Mischa Arefiev Feb 22 '13 at 10:46