Closed vchirikov closed 2 years ago
I ended without psfzf, with fzf only:
function pod() {
kubectl get pods --all-namespaces | fzf.exe --info=inline --height 40% --layout=reverse --header-lines=1 `
--prompt "$(kubectl config current-context | sed 's/-context$//')> " `
--header "Enter (kubectl exec) / CTRL-O (open log in editor) / CTRL-R (reload) /`n`n" `
--bind 'ctrl-/:change-preview-window(80%,border-bottom|hidden|)' `
--bind "enter:execute-silent(wt.exe -w main sp -V pwsh -NoLogo -NoProfile -c kubectl exec -i -t -n {1} {2} -- sh)+abort" `
--bind 'ctrl-o:execute(kubectl logs --all-containers --namespace {1} {2} | code -)' `
--bind "ctrl-r:reload(kubectl get pods --all-namespaces)" `
--preview-window up:follow `
--preview 'kubectl logs --all-containers --tail=1000 --namespace {1} {2}'
}
Hello @kelleyma49, first of all thanks for you work. I tried to use
pods()
from https://github.com/junegunn/fzf/blob/master/ADVANCED.md#log-tailing withInvoke-Fzf
and seems it's impossible at the moment.I can't figure out how I can provide multiple bind arguments with current code:
Issue:
ctrl-o
output will be somethingkubectl logs --all-containers --namespace "default" "haproxy-ingress-56b5cf5967-j7fd7",enter:execute:kubectl exec -it --namespace "default" "haproxy-ingress-56b5cf5967-j7fd7" -- bash
So seems like it wasn't parsed correctly.Could you change https://github.com/kelleyma49/PSFzf/blob/393986b0573ee6ac9956d7aaddae11e9ad332ef2/PSFzf.Base.ps1#L338 to
string[]
or add an option to use-Bind
multiple times?