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

Editor can't be launched on Windows when using full path to editor executable #1096

Closed
cs-ghi opened this issue Nov 25, 2020 · 4 comments
Closed
Labels
bug Something isn't working 📌 This can't go stale

Comments

@cs-ghi
Copy link

cs-ghi commented Nov 25, 2020

Support Request

Environment

  • Jrnl --diagnostic output:
    jrnl: v2.5
    Python: 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)]
    OS: Windows 10

  • Install method: <!-- How did you install jrnl?
    pipx

What are you trying to do?

I am trying to change my editor to vim.

What have you tried?

I changed the value of the "editor" key on the yaml file to "vim", "gvim", "Vim", "C:\tools\vim\vim82\vim.exe" - none of them worked.
Then I tried to follow the instructions on the "recipes" page on the documentation and tried to set it to notepad++, just to see if it would work. It didn't work, either. (The path to my notepad++ executable is right)

[WinError 2] The system cannot find the file specified.

Please check the 'editor' key in your config file for errors:
'C:\\Program Files (x86)\\Notepad++\\notepad++.exe -multiInst -nosession'

Then I tried with a bunch of other text editors - the only one which worked was notepad.

Other Information

If applicable, please run jrnl with --debug and paste the output.
(The editor here is still set to notepad++, hence the error)

DEBUG    root         Parsed args: Namespace(contains=None, debug=True, delete=False, edit=False, end_date=None, excluded=[], export=False, filename=None, limit=None, on_date=None, postconfig_cmd=None, preconfig_cmd=None, short=False, starred=False, start_date=None, strict=False, tags=False, text=[])
DEBUG    root         Reading configuration from file C:\Users\User\.config\jrnl\jrnl.yaml
DEBUG    root         Using configuration "{'colors': {'body': 'none', 'date': 'none', 'tags': 'none', 'title': 'none'}, 'default_hour': 9, 'default_minute': 0, 'editor': 'C:\\Program Files (x86)\\Notepad++\\notepad++.exe -multiInst -nosession', 'encrypt': False, 'highlight': True, 'indent_character': '|', 'journals': {'default': 'C:\\Users\\User\\Desktop\\Journal\\journal.txt', 'b': 'C:\\Users\\User\\Desktop\\Journal\\buddhism.txt'}, 'linewrap': 79, 'tagsymbols': '@', 'template': False, 'timeformat': '%Y-%m-%d %H:%M', 'version': 'v2.5'}"
DEBUG    root         Using journal name: default
DEBUG    root         opened PlainJournal with 12 entries
DEBUG    root         Write mode: starting
DEBUG    root         Write mode: opening editor
DEBUG    root         Write mode: loading template for entry
DEBUG    root         Write mode: no template configured
[WinError 2] The system cannot find the file specified

Please check the 'editor' key in your config file for errors:
    'C:\\Program Files (x86)\\Notepad++\\notepad++.exe -multiInst -nosession'
@cs-ghi cs-ghi added 🆕 New! support End user support labels Nov 25, 2020
@cs-ghi
Copy link
Author

cs-ghi commented Nov 25, 2020

Update: it worked when I copied and pasted the Vim.exe file in my %windir%\system32\ folder and then changed the value of the 'editor' key to "Vim"

@micahellison
Copy link
Member

Thanks for the post and the update. I think you have found a Windows compatibility bug in jrnl.

I'm trying to reproduce this, and the editor key works for me when the exe is in the path (just like it does for you), but not when I spell out the whole path.

The problem appears to be that it's transforming backslashes into two backslashes.

My editor key:

C:\Program Files\Sublime Text 3\subl.exe -w

My error message:

[WinError 2] The system cannot find the file specified

Please check the 'editor' key in your config file for errors:
    'C:\\Program Files\\Sublime Text 3\\subl.exe -w'

I'll see about getting a fix for this in our next release.

@micahellison micahellison added 📌 This can't go stale bug Something isn't working and removed 🆕 New! support End user support labels Nov 25, 2020
@micahellison micahellison changed the title Editor on windows Editor can't be launched on Windows when using full path to editor executable Nov 25, 2020
@claviger-pc
Copy link

for me, I switched to single quotes with the doubled backslashes and this resolves the problem

@micahellison
Copy link
Member

This was fixed by #1153.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📌 This can't go stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants