org-roam-server icon indicating copy to clipboard operation
org-roam-server copied to clipboard

File no longer exists: c:/WINDOWS/system32/org-protocol:/roam-file/?file=

Open wxknxxzj opened this issue 3 years ago • 4 comments

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?

wxknxxzj avatar Oct 19 '20 12:10 wxknxxzj

Does the same thing happen withorg-roam-graph

goktug97 avatar Oct 19 '20 15:10 goktug97

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

goktug97 avatar Nov 03 '20 18:11 goktug97

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 to cmd /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"

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.

aizensoosuke avatar Mar 18 '21 22:03 aizensoosuke

If meet a similar problem and then come here, you can also look at the related issue which has solved mine.

icyzeroice avatar Oct 17 '21 03:10 icyzeroice