diff --git a/Library/Homebrew/os.rb b/Library/Homebrew/os.rb index 4281aa4fd2..da59954324 100644 --- a/Library/Homebrew/os.rb +++ b/Library/Homebrew/os.rb @@ -69,7 +69,11 @@ module OS elsif OS.linux? require "os/linux" ISSUES_URL = "https://docs.brew.sh/Troubleshooting" - PATH_OPEN = (OS::Linux.wsl? ? "wslview" : "xdg-open").freeze + PATH_OPEN = if OS::Linux.wsl? && (wslview = which("wslview").presence) + wslview.to_s + else + "xdg-open" + end.freeze end sig { returns(T::Boolean) }