diff --git a/internal/uri/uri.go b/internal/uri/uri.go index 90ba3b05a..76633110f 100644 --- a/internal/uri/uri.go +++ b/internal/uri/uri.go @@ -206,5 +206,13 @@ func IsWSLURI(uri string) bool { return false } - return u.Scheme == "file" && u.Host == "wsl$" + if u.Scheme == "file" && u.Host == "wsl$" { + return true + } + + if u.Scheme == "file" && u.Host == "wsl.localhost" { + return true + } + + return false } diff --git a/internal/uri/uri_test.go b/internal/uri/uri_test.go index e75aa5a66..a9c289df9 100644 --- a/internal/uri/uri_test.go +++ b/internal/uri/uri_test.go @@ -193,6 +193,11 @@ func TestIsWSLURI(t *testing.T) { uri: `file://wsl%24/Ubuntu/home/james/some/path`, want: true, }, + { + name: "Localhost WSL file path should return true", + uri: `file://wsl.localhost/Ubuntu/home/james/foo`, + want: true, + }, { name: "Regular file path should return false", uri: `file://C:/foo/james/foo`,