bonnefoa / kubectl-fzf

A fast kubectl autocompletion with fzf
MIT License
447 stars 33 forks source link

FZF Config error on tab completion #5

Closed dan-kez closed 5 years ago

dan-kez commented 5 years ago

Hello! Thanks for making this plugin - I'm very excited to use it!

I'm running into an issue where tab completion does does attempt to trigger fzf but it appears that there is a configuration error. I have included the output of a few commands below

k get pods invalid preview window layout: down:
invalid preview window layout: down:
invalid preview window layout: down:
k get nodes awk: syntax error at source line 1
 context is
         >>> {a[$5][ <<<
awk: illegal statement at source line 1
awk: illegal statement at source line 1
join: malformed -o option field
invalid preview window layout: down:
awk: syntax error at source line 1
 context is
         >>> {a[$5][ <<<
awk: illegal statement at source line 1
awk: illegal statement at source line 1
join: malformed -o option field
invalid preview window layout: down:
awk: syntax error at source line 1
 context is
         >>> {a[$5][ <<<
awk: illegal statement at source line 1
awk: illegal statement at source line 1
join: malformed -o option field
invalid preview window layout: down:

I've installed using the following:

go get -u github.com/bonnefoa/kubectl-fzf/cmd/cache_builder
# If you update, you need to recompile cache_builder with
go install github.com/bonnefoa/kubectl-fzf/cmd/cache_builder

and


# zsh version
echo "source <(kubectl completion zsh)" >> ~/.zshrc
echo "source $GOPATH/src/github.com/bonnefoa/kubectl-fzf/kubectl_fzf.sh" >> ~/.zshrc

I have run cache_builder successfully

Anythoughts/. I am on OSX.

omrikiei commented 5 years ago

Hi, also encountered it, issued a fix..

bonnefoa commented 5 years ago

What fzf version do you have? --preview-window option was introduced with fzf 0.13.0. I'm running version 0.18.0

omrikiei commented 5 years ago

@bonnefoa thank you for a very cool and useful tool. I've experienced the same issue with fzf 0.18.0. I was able to resolve the invalid preview window layout: down: error by removing leading spaces from the wc command for counting Header columns(see pull request) Regarding the other issue with awk, I think that osx uses nawk by default - which does not support the multidimensional arrays syntax as in gawk(a[i][j]) this can be fixed either by installing gawk or refraining from this syntax.

bonnefoa commented 5 years ago

Both issues should be fixed on master now. Thanks for the report!