-
Notifications
You must be signed in to change notification settings - Fork 903
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
SOPS errors out if the value of the EDITOR environment variable contains spaces. #778
Comments
Discovered that one can use the legacy file name convention to describe file and folder names longer than 8 characters, like this: $env:EDITOR = 'C:/Progra~2/Notepad++/notepad++.exe' Notice the forward slashes as well. SOPS doesn't seem to support backslashes in the path. |
Notepad++ runs asynchronously by default, so basically if one chooses to use Notepad++ as the editor, as soon as sops opens up Notepad++, sops exits and says "File has not changed, exiting.". Just as a reference for people stumbling upon this problem, to make Notepad++ run synchronously, give the $env:EDITOR = 'C:/Progra~2/Notepad++/notepad++.exe -multiInst -nosession -notabbar' Haven't tried to set a permanent system wide environment variable yet but I suppose it works there as well. |
This is because we use shlex when parsing the $EDITOR: We have to way of knowing if the thing after the space is an argument or a path with a space. Have you tried quoting the path? |
Understandable. Good idea about the quotes, I'll try tomorrow.
…On Wed, Dec 2, 2020, 18:42 Adrian Utrilla ***@***.***> wrote:
This is because we use shlex when parsing the $EDITOR:
https://github.com/mozilla/sops/blob/38b25bd449619e1d6da20e637702f7c73203aa44/cmd/sops/edit.go#L260
We have to way of knowing if the thing after the space is an argument or a
path with a space. Have you tried quoting the path?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#778 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKCBSZ3QPDCQ4LE62ALA7TSSZVBBANCNFSM4UKOXT3Q>
.
|
Or today. Looks like setting the path this way makes it work: $env:EDITOR = "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -nosession -notabbar" Case solved, thanks! |
Above worked for me....have to add correct notepad++ path. However, while saving the file, it keeps saying that file is opened in another program and doesn't allow to save. Any trick to solve this problem? @akunaatrium |
In Windows 10, using PowerShell 5.1 when setting the environment variable EDITOR as follows:
And trying to edit a file using sops like this:
sops.exe .\file.enc.yaml
The following error message is returned:
Could not run editor: exec: "C:Program": file does not exist
Expected behavior would be that the editor is opened up.
Is there any workaround or solution to this (didn't try a path without spaces and don't consider that as a viable workaround anyway).
The text was updated successfully, but these errors were encountered: