Context: Myriad-Dreamin/tinymist#837
I want to have a robust way to open files by system default application. I simply use open crate by:
log::info!("open with system default apps: {path:?}");
if let Err(e) = ::open::that_detached(path) {
log::error!("failed to open with system default apps: {e}");
};
At first glance, it worked well when I set default application as Adobe Acrobat or Edge. But I saw node-package-open's limitation,
This extension use two ways to open file in external applications.
1. Node package: open
This package has one limit that can't open a file which is also made by electron. For example, you can't open md file in typora using this package. The openCommand, args configuration item is also supported by this package. When isElectronApp: false(by default), extension will use this way.
I was interested in checking whether our implementation worked in the case. Then I set the default application to "Visual Studio Code".

❎ But unluckily, it silently failed.
-
✅ I then double clicked the pdf file, explorer helped me to open the file in "Visual Studio Code".
-
✅ I also ran the command in console, it worked:
cmd /c start "" "c:\\Users\\xxx\\test.pdf"
-
❎ I have also tested opener, they silently failed as well.
Context: Myriad-Dreamin/tinymist#837
I want to have a robust way to open files by system default application. I simply use
opencrate by:At first glance, it worked well when I set default application as
Adobe AcrobatorEdge. But I saw node-package-open's limitation,I was interested in checking whether our implementation worked in the case. Then I set the default application to "Visual Studio Code".
❎ But unluckily, it silently failed.
✅ I then double clicked the pdf file, explorer helped me to open the file in "Visual Studio Code".
✅ I also ran the command in console, it worked:
❎ I have also tested
opener, they silently failed as well.