Skip to content

Commit

Permalink
#2130 allow sudo -E env fzf completion
Browse files Browse the repository at this point in the history
  • Loading branch information
MenkeTechnologies authored and MenkeTechnologies committed Mar 20, 2021
1 parent 4c06da8 commit 03a740a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions shell/completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ __fzf_extract_command() {
tokens=(${(z)1})
for token in $tokens; do
token=${(Q)token}

# sudo -E env kill <tab> should still fzf complete
if [[ $token == sudo || $token == env || $token == command || $token == builtin || "$token" =~ [-].* ]]; then
continue
fi

if [[ "$token" =~ [[:alnum:]] && ! "$token" =~ "=" ]]; then
echo "$token"
return
Expand Down

0 comments on commit 03a740a

Please sign in to comment.