From 3e6fc271c4ca77a87eaad54e55ffae87a866f50d Mon Sep 17 00:00:00 2001 From: Maxim Belkin Date: Thu, 2 Mar 2023 15:54:37 +0000 Subject: [PATCH] os.rb: fix for WSL systems without wslview Co-authored-by: Mike McQuaid --- Library/Homebrew/os.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) }