From 952fdedd73dfe7c750948d7061cdaeb7604c5525 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Fri, 6 Mar 2026 19:46:56 -0800 Subject: [PATCH 1/2] Use `wslview` on WSL + minor rewrite `wslview` has been included by default in WSL for a while now. --- modules/ui_common.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/ui_common.py b/modules/ui_common.py index 48c399a9e..59833f8aa 100644 --- a/modules/ui_common.py +++ b/modules/ui_common.py @@ -249,12 +249,14 @@ def open_folder(result_gallery, gallery_index = 0): path = os.path.normpath(folder) if platform.system() == "Windows": os.startfile(path) # pylint: disable=no-member - elif platform.system() == "Darwin": - subprocess.Popen(["open", path]) # pylint: disable=consider-using-with + return + if platform.system() == "Darwin": + opener = "open" elif "microsoft-standard-WSL2" in platform.uname().release: - subprocess.Popen(["wsl-open", path]) # pylint: disable=consider-using-with + opener = "wslview" else: - subprocess.Popen(["xdg-open", path]) # pylint: disable=consider-using-with + opener = "xdg-open" + subprocess.Popen([opener, path]) # pylint: disable=consider-using-with def create_output_panel(tabname, preview=True, prompt=None, height=None, transfer=True, scale=1, result_info=None): From 61b98de9e2a2eb4f9af1b80bfda70948f2bd88ac Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Sat, 7 Mar 2026 14:52:10 -0800 Subject: [PATCH 2/2] Keep `wsl-open` as a fallback Very unlikely to be needed, but just in case... --- modules/ui_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui_common.py b/modules/ui_common.py index 59833f8aa..3b7530e08 100644 --- a/modules/ui_common.py +++ b/modules/ui_common.py @@ -253,7 +253,7 @@ def open_folder(result_gallery, gallery_index = 0): if platform.system() == "Darwin": opener = "open" elif "microsoft-standard-WSL2" in platform.uname().release: - opener = "wslview" + opener = "wslview" if shutil.which("wslview") is not None else "wsl-open" else: opener = "xdg-open" subprocess.Popen([opener, path]) # pylint: disable=consider-using-with