kubectl-edit-status icon indicating copy to clipboard operation
kubectl-edit-status copied to clipboard

Doesn't work on Windows

Open oguzhand95 opened this issue 3 years ago • 2 comments

Windows version did not work because software tried to launch vi. Tried to use --editor flag, but couldn't manage to utilize notepad.exe either.

oguzhand95 avatar Apr 30 '21 11:04 oguzhand95

Hi @oguzhand95, Thank you for reporting this. Currently, I don't have a Windows machine to troubleshoot this issue. But if I can get my hands on one, I will try to troubleshoot it, let you know.

Have a wonderful day!

ulucinar avatar May 01 '21 10:05 ulucinar

I ran into what I'm guessing is basically the same problem. Of course, windows systems don't ship with vi, so that won't work out of the box.

Specifying notepad as the editor (using -e notepad) seems like it would work (notepad opens with the resource), but then notepad itself gets in the way when you try to save the file. Notepad has a pathological need to a) not save files in appdata/local/temp and b) add a .txt extension when you do save. If you wrestle with it to save the file back in the original path that was opened so that the file that edit-status wrote is actually modified before the notepad process ends, everything works as expected.

If you have Visual Studio Code installed, this ends up being a much better experience. However, you do need to specify the -w/--wait flag. As suggested in the usage instructions in the README, setting the EDITOR or KUBE_EDITOR environment variable to code -w (assuming code is in the path) does the trick nicely.

mprigge avatar Mar 15 '22 05:03 mprigge