-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
showExportFileIn: systemDefault
does not work for non-ASCII file paths
#837
Comments
Let's turn to use rust's
Edit: The following code works perfectly with "Adobe Acrobat", "Visual Studio Code", and Edge as default app: #[cfg(not(target_os = "windows"))]
let do_open = ::open::that_detached;
#[cfg(target_os = "windows")]
fn do_open(path: impl AsRef<std::ffi::OsStr>) -> std::io::Result<()> {
::open::with_detached(path, "explorer")
} |
Thanks for such a quick fix, and looking forward to the next release! |
@YDX-2147483647 you could check https://github.com/Myriad-Dreamin/tinymist?tab=readme-ov-file#installing-regularnightly-prebuilds-from-github to install latest prebuilts quickly |
Thanks. I can verify that Sumatra PDF also works. |
Describe the bug
tinymist.showExportFileIn
tosystemDefault
.*.typ
under a non-ASCII path.Package/Software version:
VSCode version:
tinymist extension version:
v0.12.2
.Logs:
tinymist server log(Output Panel -> tinymist):
The folder path, which I truncated to
…
, contains Han characters.tinymist client log(Help -> Toggle Developer Tools -> Console):
系统找不到指定的文件 means the system cannot find the specified file.
Additional context
The feature was added in #636.
The VS Code API
vscode.env.openExternal
may not support non-ASCII file paths.See microsoft/vscode#88273 or microsoft/vscode#85930.
Currently, opening with the system default robustly might be too complicated to implement or maintain. Therefore, I suggest documenting the edge case and/or recommending third-party extensions (as has been done with vscode-pdf).
Reference implementations
LaTeX Workshop
They implement
latex-workshop.view.pdf.external.viewer.command
by spawning a new program.Pseudo code extracted from https://github.com/James-Yu/LaTeX-Workshop/blob/fb0e2b0c43fcdc1e888f036a2da1c19070f8d3a3/src/preview/viewer.ts#L218:
By the way, they use
vscode.env.openExternal
toviewInBrowser
https://github.com/James-Yu/LaTeX-Workshop/blob/fb0e2b0c43fcdc1e888f036a2da1c19070f8d3a3/src/preview/viewer.ts#L116
A dedicated extension
Disclamer: I am not actively using the extension. I am astonished when I see my own comments in tjx666/open-in-external-app#5.
https://github.com/tjx666/open-in-external-app/blob/bbf107674fbc053e52b61efb69023e2719ce6438/README.md?plain=1#L90-L98
The text was updated successfully, but these errors were encountered: