Skip to content

fix(wsl): add a PowerShell fallback for notifications - #139

Merged
pyrech merged 1 commit into
mainfrom
copilot/check-powershell-path-fallback
Jul 22, 2026
Merged

fix(wsl): add a PowerShell fallback for notifications#139
pyrech merged 1 commit into
mainfrom
copilot/check-powershell-path-fallback

Conversation

Copilot AI commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Some WSL environments disable Windows PATH injection, which makes powershell.exe unavailable even though Windows interop is still enabled. In that case, PowerShell notifications stop working because the driver only probes the command by name.

  • Binary resolution

    • keep powershell.exe as the default on Windows and WSL
    • when running inside WSL, fall back to /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe if powershell.exe is not resolvable from PATH
  • Driver behavior

    • isolate binary lookup behind small helper methods so the WSL-specific resolution path is explicit and testable
    • preserve current behavior when powershell.exe is already available
  • Coverage

    • add focused tests for:
      • WSL + powershell.exe available → keep default binary
      • WSL + powershell.exe missing + absolute Windows path available → use fallback
  • Documentation

    • document the WSL fallback in the driver reference
if ($this->isRunningInsideWsl()
    && !$this->isBinaryAvailableForCommand(self::BINARY)
    && $this->isBinaryAvailableForCommand(self::WSL_FALLBACK_BINARY)
) {
    return self::WSL_FALLBACK_BINARY;
}

Copilot AI requested a review from damienalexandre July 17, 2026 11:51
@damienalexandre damienalexandre changed the title Add a WSL fallback for PowerShell notifications fix(wsl): add a PowerShell fallback for notifications Jul 17, 2026
@damienalexandre
damienalexandre marked this pull request as ready for review July 17, 2026 12:04
Comment thread src/Driver/PowerShellDriver.php Outdated

@pyrech pyrech left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@pyrech

pyrech commented Jul 22, 2026

Copy link
Copy Markdown
Member

@copilot Can you squash your commits, please?

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Can you squash your commits, please?

I can’t rewrite/squash existing commits from this agent environment because force-push is not available here. If you want a single commit on the PR branch, please squash locally or use the repository UI at merge time.

Copilot AI requested a review from pyrech July 22, 2026 08:48
@pyrech
pyrech force-pushed the copilot/check-powershell-path-fallback branch from fb8043b to c673f06 Compare July 22, 2026 08:50
@pyrech
pyrech merged commit 2217a3f into main Jul 22, 2026
6 checks passed
@pyrech
pyrech deleted the copilot/check-powershell-path-fallback branch July 22, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants