Still some URL issues on Linux

Steps to reproduce

  1. Open Obsidian using a URL. Even directly (which is my preferred method): obsidian "obsidian:///home/user/notes/my_note.md".

Expected result

I expect Obsidian to open the file, and the command that called it should return a 0 status code.

Actual result

The note indeed opens, but an error is displayed in the terminal, and the command doesn’t return until I kill it. This is a problem for external tools that wish to call Obsidian for opening a file.
This is the error displayed:

(node:782621) UnhandledPromiseRejectionWarning: Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
    at doWrite (_stream_writable.js:427:19)
    at writeOrBuffer (_stream_writable.js:415:5)
    at WriteStream.Writable.write (_stream_writable.js:305:11)
    at fn (/tmp/.mount_obsidiGXTsuj/resources/app.asar/main.js:37:10)
    at update (/tmp/.mount_obsidiGXTsuj/resources/app.asar/main.js:168:3)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:782621) UnhandledPromiseRejectionWarning: Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
    at doWrite (_stream_writable.js:427:19)
    at writeOrBuffer (_stream_writable.js:415:5)
    at WriteStream.Writable.write (_stream_writable.js:305:11)
    at fn (/tmp/.mount_obsidiGXTsuj/resources/app.asar/main.js:37:10)
    at update (/tmp/.mount_obsidiGXTsuj/resources/app.asar/main.js:168:3)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:782621) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:782621) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:782621) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

P.S: it would also be nice if when opening a note this way, the note’s text will be in focus so I can instantly write or search/navigate with the keyboard to where I want.

Environment

  • Operating system: Linux Manjaro
  • Obsidian version: 0.9.2

Additional information

A couple of questions:

  • Are you using the AppImage or snap?
  • What’s your installer version?
  • Did you try encoding the underscore in the filename? I’m not sure if this is needed, but it can’t hurt to double check

That’s an important point that I didn’t consider.
I was with a very old installer and upgrading it helped a great deal.
With the 0.9.2 installer, the command does exit, yet still with an error (after properly opening the file):

(electron) 'allowRendererProcessReuse' is deprecated and will be removed.
Loading main app package /tmp/.mount_obsidirsKAr7/resources/obsidian.asar

undefined:0

illegal access
(Use `node --trace-uncaught ...` to show where the exception was thrown)

It’s an AppImage, and there are no underscores or any special symbols in the filename.

That message is “normal” and unrelated to the URL, so you should be good to go!

Great, issue closed :slight_smile: