8000 Cannot open a new file in editor in Windows · Issue #499 · zk-org/zk · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Cannot open a new file in editor in Windows #499

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

Closed
2 tasks done
apraga opened this issue Jan 27, 2025 · 4 comments · Fixed by #502
Closed
2 tasks done

Cannot open a new file in editor in Windows #499

apraga opened this issue Jan 27, 2025 · 4 comments · Fixed by #502

Comments

@apraga
Copy link
Contributor
apraga commented Jan 27, 2025

Check if applicable

  • I have searched the existing issues (required)
  • I'm willing to help fix the problem and contribute a pull request

Describe the bug

Hi,

zk new --title "test" fails to open the file in editor, even though the file is created.

Le chemin d’accès spécifié est introuvable. ("cannot find the path" in French)
zk: error: operation aborted by editor: hx.exe C:\Users\apraga\notes\m4jl.md: exit status 1

Tested on nushell and powershell, neovim and helix.

Thanks

How to reproduce?

  1. zk new --title "test" fails to open the file in editor

zk configuration

[note]
template = "default.md"

[format.markdown]

# Enable support for #hashtags.
hashtags = false
# Enable support for :colon:separated:tags:.
colon-tags = false
# Enable support for Bear's #multi-word tags#
# Hashtags must be enabled for multi-word tags to work.
multiword-tags = false


# EXTERNAL TOOLS
[tool]

# Default editor used to open notes. When not set, the EDITOR or VISUAL
# environment variables are used.
editor = "hx.exe"
[lsp]

[lsp.diagnostics]
# Each diagnostic can have for value: none, hint, info, warning, error

# Report titles of wiki-links as hints.
#wiki-title = "hint"
# Warn for dead links between notes.
dead-link = "error"

Environment

zk 0.14.1-32-g87ac1cc
Windows 10
@tjex
Copy link
Member
tjex commented Jan 27, 2025

Unfortunately windows is barely supported. The only real reason it works on windows is because it's a cli tool and can be built from source on a windows machine. It's sad, I know, but tis the way it is.

So I can only give some thoughts.

Have you added hx as an environment variable in Windows (I think there's an app / gui for that on windows...)

Otherwise, from memory I saw this problem before, and it could be you need to supply the full path to the exe.

@apraga
Copy link
Contributor Author
apraga commented Jan 28, 2025 via email

@apraga
Copy link
Contributor Author
apraga commented Jan 28, 2025

@tjex This can be fixed by removing < /dev/tty here for Windows

cmd := executil.CommandFromString(e.editor + " " + shellquote.Join(paths...) + " </dev/tty")

apraga added a commit to apraga/zk that referenced this issue Jan 29, 2025
Fixes zk-org#499 by removing /dev/tty on Windows
@CosmoCarpincho
Copy link

Thanks, it worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
0