Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can’t use --height in fzf options on Windows #385

Open
Aankhen opened this issue Apr 21, 2023 · 2 comments
Open

Can’t use --height in fzf options on Windows #385

Aankhen opened this issue Apr 21, 2023 · 2 comments

Comments

@Aankhen
Copy link

Aankhen commented Apr 21, 2023

All this works fine under Linux (ignoring that I didn’t choose an option):

$ FZF_DEFAULT_OPTS='--height 10% --min-height 20 -e'
$ fzf --ansi --no-preview 2>&1 | echo

$ kubectx
error: you did not choose any of the options

But on Windows:

❯❯ $env:FZF_DEFAULT_OPTS = '--height 10% -e'
❯❯ fzf --ansi --no-preview 2>&1 | echo
--height option is currently not supported on this platform
 ✗ kubectx
--height option is currently not supported on this platform
error: you did not choose any of the options

This is because, in fzf, it’s assumed that the stream always supports whatever LightRenderer is under Linux, but the logic is more complicated under Windows. My Go is very limited and I’m out of my depth with this terminal stuff. Is there any way for kubectx to convince fzf that the STDERR it passes supports whatever it needs to run?

(The reason why I need --height is that otherwise it clears the screen every time fzf runs, unlike under Linux where it renders independently and then returns to the shell session.)

@ahmetb
Copy link
Owner

ahmetb commented Apr 22, 2023

Yeah this is a bit tricky. I suspect we pass the same stderr that we get in both Go and Bash based implementations of kubectx. I'm inclined to think this is gonna be hard to troubleshoot and fix on our side. I recommend WSL. 🤷🏼

@Aankhen
Copy link
Author

Aankhen commented Apr 22, 2023

I understand. It seems like a difficult thing to address, if that’s even possible. I prefer to use Windows, not WSL, so I’ll look for an alternative for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants