fix(core): handle Windows paths under WSL#27025
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request improves cross-platform compatibility by enabling the CLI to correctly handle Windows-style paths when executed within a Windows Subsystem for Linux (WSL) environment. By mapping Windows drive paths to standard WSL mount points, the changes ensure that file system operations remain consistent across different operating system configurations without affecting native Windows or non-WSL environments. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for Windows Subsystem for Linux (WSL) path translation within the core utility functions. It adds logic to detect WSL environments and a translateWindowsPath function that converts Windows drive paths to their corresponding WSL mount points (e.g., /mnt/c/). This translation is now integrated into toAbsolutePath, isSubpath, and resolveToRealPath to ensure consistent path handling when running under WSL. Additionally, a new set of tests has been added to verify these changes. I have no feedback to provide.
36c8326 to
9e1d589
Compare
|
Rebased this PR onto current Root cause: when the CLI runs under WSL, Windows drive-letter paths can reach the core path helpers, but Linux/Node path resolution does not translate Approach: translate Windows drive-letter paths only when WSL is detected, and preserve existing behavior for non-WSL Linux/macOS and native Windows. The added tests cover WSL translation and existing subpath/path-resolution behavior. Validation after rebase:
I kept the issue references as |
Summary
Validation
Related Issues
Related to #25527
Also related to #25184