You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:?}");ifletErr(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.
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.
The text was updated successfully, but these errors were encountered:
Thanks a lot for the detailed description of the problem!
One would think it's easy to open something with the default application consistently, but apparently not.
I think there have been many iterations on this code already, at some point it might even have used explorer but it ran into other limitations.
Thus I am not sure there is "the one working way", but wouldn't give up hope just yet either.
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:At first glance, it worked well when I set default application as
Adobe Acrobat
orEdge
. 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.The text was updated successfully, but these errors were encountered: