Steps to reproduce
- 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