From 56ae48180f1577b80479c5d2c4827a8f41b0c2be Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Wed, 28 Jan 2026 10:35:57 +0800 Subject: [PATCH] fix(wsl): fix windows wsl2 detection --- lua/gitlinker/actions.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/gitlinker/actions.lua b/lua/gitlinker/actions.lua index b782204..2a9dd45 100644 --- a/lua/gitlinker/actions.lua +++ b/lua/gitlinker/actions.lua @@ -12,14 +12,14 @@ end local function system(url) if vim.fn.has("mac") > 0 then vim.fn.jobstart({ "open", url }) - elseif vim.fn.has("win32") > 0 or vim.fn.has("win64") > 0 then + elseif vim.fn.has("win32") > 0 or vim.fn.has("win64") > 0 or vim.fn.has("wsl") > 0 then if vim.fn.executable("pwsh.exe") > 0 then vim.fn.jobstart({ "pwsh.exe", "-Command", "Start-Process", url }) elseif vim.fn.executable("powershell.exe") > 0 then vim.fn.jobstart({ "powershell.exe", "-Command", "Start-Process", url }) elseif vim.fn.executable("cmd.exe") > 0 then vim.fn.jobstart({ "cmd.exe", "/C", "start", url }) - elseif vim.fn.has("wsl") > 0 and vim.fn.executable("wslview") > 0 then + elseif vim.fn.executable("wslview") > 0 then vim.fn.jobstart({ "wslview", url }) end else