Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug#246305: zsh: completion for sudo doesn't add commands under root's path



Clint Adams wrote:
> 
> Well, you could do the equivalent of "strings =sudo | grep sbin:", but
> that seems ugly and error-prone.

That wouldn't work on my system here. It looks like there is a
"SECURE_PATH" compile option to sudo which needs to be enabled before it
uses a different path:

% PATH=/usr/bin sudo printenv PATH
/usr/bin

Out of interest, is there any way to run a process detached from the tty?
(the above sometimes prompts for a password.)

> I have a sneaking suspicion that sudo isn't the only command for which
> it would make sense to override the path for _command_names though.

If you use a style, give it a generic sounding name then. Perhaps it
could be looked up from _command_names instead of _sudo. Keep in mind
that people might want to do things like add to the existing path or
remove `.'.

Oliver



Messages sorted by: Reverse Date, Date, Thread, Author