joplin
joplin copied to clipboard
CLI: Open Neovim in external window is not working properly
I would like to use Neovim as external editor in a new window like in the desktop app. However, opening the external window results in a blank page of the Joplin CLI as long as Neovim is open.
Environment
Joplin version: 2.12.15-1 Platform: Linux CLI OS specifics: Archlinux
Steps to reproduce
- Set Neovim as external editor to open with Kitty (xterm has the same issue):
config editor "kitty -- nvim"
- Open a note
- A new kitty terminal with the correct markdown file in Neovim is spawned
- The terminal with Joplin running shows a blank page, except the error message (on xterm there is no error message, but also blank page):
[glfw error 65544]: process_desktop_settings: failed with error: [org.freedesktop.DBus.Error.UnknownMethod] No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop
- When the markdown file is saved and Neovim is closed, the terminal with Joplin is working correctly again and shows the updated note.
Describe what you expected to happen
In step 4., the terminal with Joplin stays open and I can open other notes.
Logfile
2023-09-28 22:20:47: App: "Profile directory: /home/user/.config/joplin"
2023-09-28 22:20:47: App: "Root profile directory: /home/user/.config/joplin"
2023-09-28 22:20:47: "Database was open successfully"
2023-09-28 22:20:47: "Checking for database schema update..."
2023-09-28 22:20:47: "Current database version", "{"version":43,"table_fields_version":43}"
2023-09-28 22:20:47: "Upgrading database from version 43"
2023-09-28 22:20:47: "New version: 43. Previously recorded version: 43"
2023-09-28 22:20:47: "KeychainService: checking if keychain supported"
2023-09-28 22:20:47: "KeychainService: check was already done - skipping. Supported:", "0"
2023-09-28 22:20:47: handleSyncStartupOperation: "Processing operation:", "0"
2023-09-28 22:20:47: App: "Client ID: XXXXX"
2023-09-28 22:20:47: models/Setting: "Applying default migrations..."
2023-09-28 22:20:47: e2ee/utils: "activeMasterKeySanityCheck: Active key is an enabled key - nothing to do"
2023-09-28 22:20:47: e2ee/utils: "Trying to load 1 master keys..."
2023-09-28 22:20:47: e2ee/utils: "findMasterKeyPassword: No master password is defined - trying to get master key specific password"
2023-09-28 22:20:47: EncryptionService: "Loading master key: XXXXXX. Make active:", "true"
2023-09-28 22:20:47: e2ee/utils: "Loaded master keys: 1"
2023-09-28 22:20:47: "ResourceFetcher: Auto-add resources: Mode: always"
2023-09-28 22:20:47: "ResourceFetcher: Auto-added resources: 0"
2023-09-28 22:20:47: "Setting up recurrent sync with interval 300"
2023-09-28 22:20:47: App: "Refreshing notes:", "null", "null"
2023-09-28 22:20:47: App: ""syncInfoCache" was changed - setting up encryption related code"
2023-09-28 22:20:47: e2ee/utils: "activeMasterKeySanityCheck: Active key is an enabled key - nothing to do"
2023-09-28 22:20:47: e2ee/utils: "Trying to load 1 master keys..."
2023-09-28 22:20:47: e2ee/utils: "Loaded master keys: 1"
2023-09-28 22:20:47: "Scheduling sync operation...", "10000"
2023-09-28 22:20:47: "Setting up recurrent sync with interval 300"
2023-09-28 22:20:47: App: ""syncInfoCache" was changed - setting up encryption related code"
2023-09-28 22:20:47: e2ee/utils: "activeMasterKeySanityCheck: Active key is an enabled key - nothing to do"
2023-09-28 22:20:47: e2ee/utils: "Trying to load 1 master keys..."
2023-09-28 22:20:47: e2ee/utils: "Loaded master keys: 1"
2023-09-28 22:20:47: "Scheduling sync operation...", "10000"
2023-09-28 22:20:47: App: ""syncInfoCache" was changed - setting up encryption related code"
2023-09-28 22:20:47: e2ee/utils: "activeMasterKeySanityCheck: Active key is an enabled key - nothing to do"
2023-09-28 22:20:47: e2ee/utils: "Trying to load 1 master keys..."
2023-09-28 22:20:47: e2ee/utils: "Loaded master keys: 1"
2023-09-28 22:20:47: "Scheduling sync operation...", "10000"
2023-09-28 22:20:47: RevisionService: "runInBackground: Starting background service with revision collection interval 600000"
2023-09-28 22:20:47: App: "Refreshing notes:", "2", "444a51fa8fba4708b6d40156c60d5c2f"
2023-09-28 22:20:47: App: "Rebuilding items...", "Folder", "444a51fa8fba4708b6d40156c60d5c2f", "null"
2023-09-28 22:20:48: "DecryptionWorker: starting decryption..."
2023-09-28 22:20:48: "DecryptionWorker: completed decryption."
2023-09-28 22:20:48: App: "Shortcut:", "l", "{"keys":["TAB","l"],"type":"tkwidgets","command":"focus_next","canRunAlongOtherCommands":false}"
2023-09-28 22:20:48: App: "Handle: folderList: TAB", "true"
2023-09-28 22:20:48: App: "Handle: noteList: TAB", "false"
2023-09-28 22:20:48: App: "Handle: noteText: TAB", "false"
2023-09-28 22:20:48: App: "Handle: noteMetadata: TAB", "false"
2023-09-28 22:20:48: App: "Handle: noteLayout: TAB", "false"
2023-09-28 22:20:48: App: "Handle: hLayout: TAB", "false"
2023-09-28 22:20:48: App: "Handle: console: TAB", "false"
2023-09-28 22:20:48: App: "Handle: statusBar: TAB", "false"
2023-09-28 22:20:48: App: "Handle: vLayout: TAB", "false"
2023-09-28 22:20:48: App: "Handle: mainWindow: TAB", "false"
2023-09-28 22:20:48: App: "Handle: root: TAB", "null"
2023-09-28 22:20:48: App: "Shortcut:", "l", "{"keys":["TAB","l"],"type":"tkwidgets","command":"focus_next","canRunAlongOtherCommands":false}"
2023-09-28 22:20:48: App: "Handle: folderList: TAB", "false"
2023-09-28 22:20:48: App: "Handle: noteList: TAB", "true"
2023-09-28 22:20:48: App: "Handle: noteText: TAB", "false"
2023-09-28 22:20:48: App: "Handle: noteMetadata: TAB", "false"
2023-09-28 22:20:48: App: "Handle: noteLayout: TAB", "false"
2023-09-28 22:20:48: App: "Handle: hLayout: TAB", "false"
2023-09-28 22:20:48: App: "Handle: console: TAB", "false"
2023-09-28 22:20:48: App: "Handle: statusBar: TAB", "false"
2023-09-28 22:20:48: App: "Handle: vLayout: TAB", "false"
2023-09-28 22:20:48: App: "Handle: mainWindow: TAB", "false"
2023-09-28 22:20:48: App: "Handle: root: TAB", "null"
2023-09-28 22:20:49: App: "Shortcut:", "ENTER", "{"keys":["ENTER"],"type":"function","command":"activate","canRunAlongOtherCommands":false}"
2023-09-28 22:20:49: "Disabling fullscreen..."
2023-09-28 22:20:52: RevisionService: "maintenance: Starting..."
2023-09-28 22:20:52: RevisionService: "maintenance: Service is enabled"
2023-09-28 22:20:52: RevisionService: "collectRevisions: Created revisions for 0 notes"
2023-09-28 22:20:52: RevisionService: "maintenance: Done in 103ms"
2023-09-28 22:20:55: App: "Shortcut:", ":", "{"keys":[":"],"type":"function","command":"enter_command_line_mode","canRunAlongOtherCommands":false}"
I suspect the terminal version is expecting to open within its own terminal session and not spawn a new window which is why it "halts" waiting for the editor to be closed.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
The issue is not resolved. I created a topic on the Joplin forum.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
The issue is not resolved.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
The issue is not resolved.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
The issue is not resolved.
For now, I'm adding this to backlog
.
Currently, the CLI app uses spawnSync
to launch the editor:
https://github.com/laurent22/joplin/blob/dd04a39f3b0add299adc0bf26e74c68813414ce3/packages/app-cli/app/command-edit.ts#L79-L80
This pauses Joplin CLI until the editor exits. Joplin then saves the edited document:
https://github.com/laurent22/joplin/blob/dd04a39f3b0add299adc0bf26e74c68813414ce3/packages/app-cli/app/command-edit.ts#L92
To fix this, we may have to change this to something close to how external editing is handled on desktop.