From 4ea72dec994720cc0c3d97e8273a4f98143bdae7 Mon Sep 17 00:00:00 2001 From: QWsin Date: Mon, 30 Mar 2026 14:08:47 +0800 Subject: [PATCH] fix(hooks): probe WSL interop PATH before hardcoded paths Adds 'pwsh.exe' and 'powershell.exe' as candidates to leverage WSL's Windows interop PATH resolution, making the hook work with non-default WSL mount prefixes or Windows drives. --- scripts/hooks/desktop-notify.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/hooks/desktop-notify.js b/scripts/hooks/desktop-notify.js index 7ea23208..89fefd0a 100644 --- a/scripts/hooks/desktop-notify.js +++ b/scripts/hooks/desktop-notify.js @@ -42,7 +42,9 @@ function findPowerShell() { if (!isWSL()) return null; const candidates = [ - '/mnt/c/Program Files/PowerShell/7/pwsh.exe', // PowerShell 7 + 'pwsh.exe', // WSL interop resolves from Windows PATH + 'powershell.exe', // WSL interop for Windows PowerShell + '/mnt/c/Program Files/PowerShell/7/pwsh.exe', // PowerShell 7 (default install) '/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe', // Windows PowerShell ];