derailed / k9s

🐶 Kubernetes CLI To Manage Your Clusters In Style!
https://k9scli.io
Apache License 2.0
27.31k stars 1.71k forks source link

Can't use neovim as editor #2820

Open flenoir opened 3 months ago

flenoir commented 3 months ago




Describe the bug I tried to edit EDITOR or K9S_EDITOR env var to use neovim as editor but doesn't seems to work

To Reproduce Steps to reproduce the behavior:

  1. add "export EDITOR=nvim" as env variable
  2. restarts k9s

Historical Documents i did also try using K9S_EDITOR without success

Expected behavior i would like to have neovim as editor in k9s instead of classic vim

Screenshots If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

Daemoen commented 3 months ago

I don't think this is a k9s issue. I am an nvim user as well, and cannot reproduce. I use k9s and nvim literally constantly. I didn't land on version 32.4, but I did just upgrade from 32.3 to 32.5 and it still works as well. Is it possible something else is interfering in your env? I've had similar issues and it is almost always on my end.

KevinGimbel commented 3 months ago

I just tried and it works as expected for me, I can swap editors by running k9s with the EDITOR flag.

EDITOR=nano k9s
EDITOR=vim k9s
EDITOR=zed k9s

This feels like an issue with your environment.

mpas97 commented 3 months ago

The README says that KUBE_EDITOR is the variable to set. So probably try this instead of K9S_EDITOR.

KevinGimbel commented 3 months ago

@flenoir could you check again with KUBE_EDITOR? If so, does it work and can this issue be closed?

mjpieters commented 2 months ago

I think I may know what is going on.

I have an issue when I use EDITOR=vi to edit a deployment. When I try to save-and-exit with ZZ, k9s doesn't pick up the changes made, but when I use a separate save command (:w) before exiting (:q), it does pick up the change.

Hypothesis: k9 checks if the file was modified < editor exit time, but the modification time is equal to the editor exit time, and so doesn't see the file as modified?