laurent22 / joplin

Joplin - the privacy-focused note taking app with sync capabilities for Windows, macOS, Linux, Android and iOS.
https://joplinapp.org
Other
46.09k stars 5.02k forks source link

CLI: Open Neovim in external window is not working properly #8982

Open letscho123 opened 1 year ago

letscho123 commented 1 year ago

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

  1. Set Neovim as external editor to open with Kitty (xterm has the same issue): config editor "kitty -- nvim"
  2. Open a note
  3. A new kitty terminal with the correct markdown file in Neovim is spawned
  4. 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
  5. 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}"
Daeraxa commented 1 year ago

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.

github-actions[bot] commented 1 year ago

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.

letscho123 commented 1 year ago

The issue is not resolved. I created a topic on the Joplin forum.

github-actions[bot] commented 11 months ago

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.

letscho123 commented 11 months ago

The issue is not resolved.

github-actions[bot] commented 10 months ago

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.

letscho123 commented 10 months ago

The issue is not resolved.

github-actions[bot] commented 9 months ago

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.

letscho123 commented 9 months ago

The issue is not resolved.

personalizedrefrigerator commented 8 months ago

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.