Skip to content

Commit

Permalink
Fix launch default browser on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicletz committed Nov 8, 2023
1 parent 5762ef5 commit 29f91ab
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/desktop/os.ex
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,15 @@ defmodule Desktop.OS do
def launch_default_browser(file) do
spawn(fn ->
case type() do
MacOS -> System.cmd("open", [file], stderr_to_stdout: true, parallelism: true)
Linux -> System.cmd("xdg-open", [file], stderr_to_stdout: true, parallelism: true)
_other -> :wx_misc.launchDefaultBrowser(file)
MacOS ->
System.cmd("open", [file], stderr_to_stdout: true, parallelism: true)

Linux ->
System.cmd("xdg-open", [file], stderr_to_stdout: true, parallelism: true)

_other ->
Desktop.Env.wx_use_env()
:wx_misc.launchDefaultBrowser(file)
end
end)
end
Expand Down

0 comments on commit 29f91ab

Please sign in to comment.