Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Bug in sudo completions
- X-seq: zsh-workers 52254
- From: Kovid Goyal <kovid@xxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Bug in sudo completions
- Date: Tue, 31 Oct 2023 06:23:41 +0530
- Archived-at: <https://zsh.org/workers/52254>
- List-id: <zsh-workers.zsh.org>
Completions for sudo fail when specifying environment variables on the
command line. For example:
sudo a=1 ls -<TAB>
gives
No matches for: `file'
while
sudo ls -<TAB>
gives
zsh: do you wish to see all 171 possibilities (58 lines)?
This is likely because the completions script thinks any argument not
starting with - means the program to complete, which is not true.
Quoting from man sudo
sudo [-ABbEHnPS] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T timeout] [-u user] [VAR=value] [-i | -s]
[command [arg ...]]
Note that VAR=value can occur before -i or -s and before command.
--
_____________________________________
Dr. Kovid Goyal
https://www.kovidgoyal.net
https://calibre-ebook.com
_____________________________________
Messages sorted by:
Reverse Date,
Date,
Thread,
Author