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 committed Aug 10, 2020
1 parent e2ae1b2 commit 4aa4e2e
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" =~ '.*=.*' || "$token" =~ [-].* ]]; then
continue
fi

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

0 comments on commit 4aa4e2e

Please sign in to comment.