Skip to content

Commit

Permalink
Introduce Sys.isWSL()
Browse files Browse the repository at this point in the history
  • Loading branch information
PallHaraldsson authored Nov 24, 2024
1 parent fa18951 commit 9c719dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/path.jl
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ function uripath end
else
function uripath(path::String)
localpath = join(eachsplit(abspath(path), path_separator_re, keepempty=false), '/')
host = if ispath("/proc/sys/fs/binfmt_misc/WSLInterop") # WSL sigil
host = if Sys.isWSL()
distro = get(ENV, "WSL_DISTRO_NAME", "") # See <https://patrickwu.space/wslconf/>
"wsl\$/$distro" # See <https://github.com/microsoft/terminal/pull/14993> and <https://learn.microsoft.com/en-us/windows/wsl/filesystems>
else
Expand Down

0 comments on commit 9c719dc

Please sign in to comment.