Different behavior when launching external editor via CLI and Desktop App

Joplin Version (CLI): 1.6.4 (prod)
Joplin Version (Desktop): 1.7.11 (AppImage)
OS: Debian 10 (Buster)
Editor: VsCode

Howdy!

I am in the process of migrating from the CLI to the Desktop App (due to the absence of action api in the current version of the CLI), and am encountering an issue with the configuration of my external editor (VsCode). In particular, it seems that certain arguments that worked with the CLI (at least with joplin edit <NOTE>) are not working with the Desktop App.

Here is my current editor config in the CLI
/usr/bin/code -r --wait --extensions-dir .vscode/extensions-Markdown/ --user-data-dir .config/Code-Markdown/

And here it is with the Desktop App
Path: /usr/bin/code
Arguments: -r --wait --extensions-dir .vscode/extensions-Markdown/ --user-data-dir .config/Code-Markdown/

Information on VsCode command-line parameters.

The expected behavior, and what I experience with the CLI, is that the note opens in a VsCode instance preconfigured with settings found in config/Code-Markdown/ and extensions installed in .vscode/extensions-Markdown/ . Also, if an instance of such configuration already exists, the note opens in that instance instead of opening a new window.

Conversely, what I experience on the Desktop App is different. It seems to ignore the flags with parameters ( --extensions-dir .vscode/extensions-Markdown/ and --user-data-dir .config/Code-Markdown/ and instead opens an instance without the proper extensions or settings.

Thanks,
smkuehnhold

I found out pretty quickly after I posted this that changing .vscode/extensions-Markdown/ and .config/Code-Markdown/ to absolute paths (i.e. /home/smkuehnhold/.vscode/extensions-Markdown/) fixed the issue. Is the AppImage maybe run as a different user?

I have previously noticed that Joplin on Linux does not work well with paths like ~/some/dir, e.g. for file system sync or when installing a plugin from source dir.
The AppImage seems to run under my user, maybe it's an issue with Electron.

1 Like

Your post made me realize that I was using a context-relative path with the "." notation anyway. So my issue specifically might in fact be a case of user-error. I've realized joplin edit <NOTE> only works with my original configuration if my current working directory is my home directory.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.