org-roam-server
org-roam-server copied to clipboard
File no longer exists: c:/WINDOWS/system32/org-protocol:/roam-file/?file=
When I click on the node on the browser, emac prompt file does not exist, and my file is not in this position, how to solve this problem?
Does the same thing happen withorg-roam-graph
I got an email from this issue but the comment is not appearing here.
If the org-roam-graph
is also not working, the problem is probably something to do with your org-protocol
setup.
Related issues: https://github.com/org-roam/org-roam-server/issues/35 https://github.com/org-roam/org-roam-server/issues/39
I assumed, but now realize I may be wrong, that you're using wsl (Windows Subsystem for Linux). If not, I don't know how to help. Otherwise, just keep reading.
If you followed the instruction here, you can fix this with the following.
- In linux, create a script file
org-protocol-wsl.sh
containing:
#!/bin/bash
# your org roam path (be careful to not add the trailing slash)
orgroampath="~/org/zettelkasten"
orgroamdir=`basename ${orgroampath}`
# killing previous requests, otherwise they proliferate
killall emacsclient
# get the actual path that emacsclient wants. $1 will contain the bad path.
file=`echo $1 | sed -n "s/.*${orgroamdir}%2F\(.*$\)/\1/p"`
fullpath="${orgroampath}/${file}"
# for debug purposes
echo "raw : $1"
echo "path: $fullpath"
# uncomment second line and comment first line if you need to debug something.
nohup emacsclient $fullpath &
#emacsclient $fullpath
-
Change orgroampath to the value of
org-roam-directory
you set in emacs. Be careful to not add the trailing slash. -
Open regedit on windows, find the key at
HKEY_CLASSES_ROOT\org-protocol\shell\open\command
. Change its value tocmd /c start /min wsl ~/path/to/the/script/.org-protocol-wsl.sh %1
. Replace the path (the path is a linux path to your script).- This is assuming you followed the link at the top and already had this key filled with
C:\Windows\System32\wsl.exe emacsclient "%1"
- This is assuming you followed the link at the top and already had this key filled with
You're done ! That should work.
If it doesn't work, make sure the server is running (M-x start-server
).
It isn't that smooth on my configuration honestly. I'm not sure if it's because of my configuration or if it's just wsl. At least it works, but hopefully it will fixed in a more proper way.
If meet a similar problem and then come here, you can also look at the related issue which has solved mine.