obsidian-open-vscode
obsidian-open-vscode copied to clipboard
Plugin doesn't work on Linux with Flatpak
Such as related on #3, I click on ribbon button and nothing happens.
System info:
- OS: Fedora release 39 (Thirty Nine) x86_64
- Kernel: 6.5.12-300.fc39.x86_64
- DE: GNOME 45.1 (x.org)
- WM: Mutter
Obsidian
- Obsidian version: 1.4.16
- plugin version: 1.2.1
VSCode
- Version: 1.84.2
- hash: 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
- Date: 2023-11-09T10:50:47.800Z
- Electron: 25.9.2
- ElectronBuildId: 24603566
- Chromium: 114.0.5735.289
- Node.js: 18.15.0
- V8: 11.4.183.29-electron.0
- SO: Linux x64 6.5.12-300.fc39.x86_64
- packaging format: rpm
I've tried this:
- On 'Template for executing
codeCLI settings' I've putcode '{{vaultpath}}' - On 'Path to VSCode Workspace' I've put
~/Documentos/OneDrive/Obsidian/
But it still doesn't work.
However, when I run code ~/Documentos/OneDrive/Obsidian/ on terminal, VSCode is opened with the vault folder normally.
If you specify the full path it'll probably work. If you follow the issue you linked to its conclusion, that was it for them too. I'll also add this to the readme.
In case it does not:
This probably has to do with shell path or command aliases. I don't know much about the subject and won't fix this anytime soon, sorry. I'll provide the info I have and help you troubleshoot though. Is there an error on the browser dev console within Obsidian? What does it say? You can access it with F12 or Ctrl + Shift + I.
This issue I had with another plugin and the links there could help explain and solve the problem too. Other plugins that execute in shell also had this problem (one more example), and there are a lot of them.
I've turn 'Path to VSCode Workspace' value to /home/renan/Documentos/OneDrive/Obsidian/Renan and still doesn't work.
Obs.: 'OneDrive' on "Documentos" folder is a link.
On console there's this error report:
[openVSCode] exec error: Error: Command failed: code "/home/renan/Insync/[email protected]/OneDrive/Documentos/Obsidian/Renan"
/bin/sh: line 1: code: comand not found
But, if I run code "/home/renan/Insync/[email protected]/OneDrive/Documentos/Obsidian/Renan" on terminal it works.
Such as recommended, I run which code and the package folder is usr/bin/code. So, just for test, I run this path on terminal, and VSCode was opened.
But, when I change the value for 'Template for executingcode CLI settings' to usr/bin/code '{{vaultpath}}', it still doesn't work.
Now I'm thinking that this problem occurs because Obsidian is a flatpak and runs in a sandbox, so it cannot run commands on the system scope, only into the sandbox.
Flatpak may affect it too, I wouldn't know how to help with that.
What is the error on console when you set the template to usr/bin/code '{{vaultpath}}'?
Flatpak may affect it too, I wouldn't know how to help with that. What is the error on console when you set the template to
usr/bin/code '{{vaultpath}}'?
'Command not found' too
Could you try a different installation method for Obsidian? They have some here: https://obsidian.md/download. So we can see if it really is flatpak that makes this not work.
I've made the following tests:
- I've used a VM with Kubuntu 23.10, where I've installed appimage and deb packages;
- I've used the appimage version on Fedora.
In both cases, the plugin works perfectly. The problem is really the flatpak.