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

not obvious (or possible) how to use an editor with spaces in the command #72734

Open
jtnord opened this Issue Jan 9, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@jtnord
Copy link

jtnord commented Jan 9, 2019

I was trying to use a different editor than notepad on windows to be used by kubectl edit foobar by setting the EDITOR environment variable.

Doing this was non trivial and the following did not work all resulting in different errors.

What happened:

win-box > set EDITOR="c:\Program Files\notepad2\Notepad2.exe"
win-box > kubectl edit foo/bar
'\"c:\Program Files\notepad2\Notepad2.exe\"' is not recognized as an internal or external command,
operable program or batch file.
error: there was a problem with the editor "cmd /C \"c:\\Program Files\\notepad2\\Notepad2.exe\" "

win-box > set EDITOR=c:\Program Files\notepad2\Notepad2.exe
win-box > kubectl edit foo/bar
'c:\Program' is not recognized as an internal or external command,
operable program or batch file.
error: there was a problem with the editor "cmd /C c:\\Program Files\\notepad2\\Notepad2.exe "

win-box > set EDITOR=c:\Program^ Files\notepad2\Notepad2.exe
win-box > kubectl edit foo/bar
'c:\Program' is not recognized as an internal or external command,
operable program or batch file.
error: there was a problem with the editor "cmd /C c:\\Program Files\\notepad2\\Notepad2.exe "

What you expected to happen:

I should be able to use normal windows paths, either by quoting them, or not.

the workaround is to use a short filename set EDITOR=c:\progra~1\notepad2\notepad2.exe however short paths are optional and may not always be created. (reference)

How to reproduce it (as minimally and precisely as possible):

try and set an editor on windows where there is a space in the name of the command.

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version):
    v1.10.3
  • Cloud provider or hardware configuration:
    N/A this is client side issue
  • OS (e.g. from /etc/os-release):
    windows 10 1803
  • Kernel (e.g. uname -a):
    :-)
  • Install tools:
  • Others:

@jtnord jtnord added the kind/bug label Jan 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment