Closed apeschar closed 12 months ago
What would be the other way to open a link without xdg-open
?
Not everyone has their desktop set up so that this works. Or they may run typst-server
remotely via SSH and use a SSH tunnel to access the preview (what I was doing). In those cases they'd probably just click the link that is written to the terminal, or manually access the URL somehow.
Point being: absence of tools to open URLs does not imply the user doesn't have another way to open it.
So in the end: I think we should just log and ignore the error.
Sure, if you want to make a pr that just ignores the error. Just remove ?
to avoid propagating the error on the line and discard the result using _ = ...
to avoid unhandled result warning.
On Linux, if
xdg-open
is missing, it breakstypst-live
with a "file not found" error on this line.https://github.com/ItsEthra/typst-live/blob/e1fbaff9259c94d9bb16c2e8184e1293e69406ab/src/main.rs#L43C12-L43C12
If I figure out how to handle errors in Rust, I'll make my own PR. If I don't get around to it, perhaps you'd like to give it a go.