File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 11name = " PkgAuthentication"
22uuid = " 4722fa14-9d28-45f9-a1e2-a38605bd88f0"
33authors = [" Sebastian Pfitzner" , " contributors" ]
4- version = " 2.0.3 "
4+ version = " 2.1.0 "
55
66[deps ]
77Downloads = " f43a241f-c20a-4ad4-852c-f6b1247861c6"
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ import Pkg
66import Random
77import TOML
88
9+ include (" helpers.jl" )
10+
911const pkg_server_env_var_name = " JULIA_PKG_SERVER"
1012
1113# # abstract state types
@@ -520,8 +522,8 @@ function open_browser(url::AbstractString)
520522 @debug " error executing browser hook" exception= (err, catch_backtrace ())
521523 return false
522524 end
523- elseif Sys. iswindows ()
524- run (` cmd /c "start $url "` ; wait= false )
525+ elseif Sys. iswindows () || detectwsl ()
526+ run (` cmd.exe /c "start $url "` ; wait= false )
525527 elseif Sys. isapple ()
526528 run (` open $url ` ; wait= false )
527529 elseif Sys. islinux () || Sys. isbsd ()
Original file line number Diff line number Diff line change 1+ @static if isdefined (Sys, :detectwsl )
2+ const detectwsl = Sys. detectwsl
3+ else
4+ # Borrowed from Julia (MIT license)
5+ # https://github.com/JuliaLang/julia/blob/726c816b9590d748345fb615b76b685c79eafd0d/base/sysinfo.jl#L549-L555
6+ # https://github.com/JuliaLang/julia/pull/57069
7+ function detectwsl ()
8+ # We use the same approach as canonical/snapd do to detect WSL
9+ islinux () && (
10+ isfile (" /proc/sys/fs/binfmt_misc/WSLInterop" )
11+ || isdir (" /run/WSL" )
12+ )
13+ end
14+ end
You can’t perform that action at this time.
0 commit comments