ahmetb / kubectx

Faster way to switch between clusters and namespaces in kubectl
https://kubectx.dev
Apache License 2.0
17.31k stars 1.24k forks source link

git bash windows fzf error #382

Open cloud-66 opened 1 year ago

cloud-66 commented 1 year ago

image

Never mind how kubectx (golang version) installed, by downloading binary or by scoop kubectx (Enter) it works in powershell, but don't in git bash for windows. I guess because path should be in bash format /c/Users/Cloud/scoop/shims/kubectx

ahmetb commented 1 year ago

Yeah this is an interesting case. We pass kubectx's full path to fzf, I wonder if we should if-else this for mingw.

mloskot commented 1 year ago

I'm observing the same problem while running kubectx in Git Bash session in Windows Terminal:

image

but if I switch to PowerShell in the same Windows Terminal, then it works:

image

If I switch to plain Start > Git Bash, and not in Windows Terminal, then everything works:

image

Environment: I tend to install everything with winget:

$ kubectx --version
0.9.4
$ fzf --version
0.39.0 (2023040)

I'm observing the same problem with kubens. See also #307

mloskot commented 1 year ago

Update to my https://github.com/ahmetb/kubectx/issues/382#issuecomment-1498810043

In Git Bash in Windows Terminal, interestingly, if I pipe kubectx | fzf:

image

then I get no error, but this

image

But, selecting context and ENTER seems to have no effect.

mloskot commented 1 year ago

@cloud-66 See https://github.com/ahmetb/kubectx/issues/330#issuecomment-1506657091 for working workaround