Open MenkeTechnologies opened 3 years ago
Related: #1992
Thanks for the PR. Excluding a set of commands won't fix #1992 so I'd like to find a more generic solution.
solving #1992 wont fix this either. I agree excluding certain words is a bad idea but not sure how to find best solution.
I have a very similar issue here that I solved for most use cases
https://github.com/MenkeTechnologies/zsh-expand/blob/master/zsh-expand.plugin.zsh#L5.
I loop through each word from the beginning, applying regex until I found the last word that is the final command to be executed. Its kind of complicated for example to pass over options that arguments after space.
First Thing was to pull off the current statement of the command line where the cursor is. you are not doing this. Causes of #1992.
ie.
for (( i = $#mywordsleft; i >= 0; i-- )); do
# ;; ; | || && are partition separating chars
# we will split the commad line and get the partition of the caret
# aliases are valid in the first position after these chars
case $mywordsleft[$i] in
';;' | \; | \| | '||' | '&&')
firstIndex=$((i+1))
break
;;
*)
;;
esac
done
for (( i = 0; i < $#mywordsright; i++ )); do
case $mywordsright[$i] in
# ;; ; | || && are partition separating chars
# we will split the commad line and get the partition of the caret
# aliases are valid in the first position after these chars
';;' | \; | \| | '||' | '&&') lastIndex=$((i-1))
break
;;
*)
;;
esac
All of this was for alias expansion on spacebar. Maybe too much for fzf project.
For example pwd; sudo -E env -S command gst
Havent heard of a more robust solution.
man fzf
)Info
Problem / Steps to reproduce
sudo -E env kill does not invoke fzf completion.