Skip to content

Conversation

@anthonykim1
Copy link
Contributor

No description provided.

@anthonykim1 anthonykim1 self-assigned this Oct 28, 2025
Copilot AI review requested due to automatic review settings October 28, 2025 00:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where Unix-style paths (particularly for bash and other Unix shells) were being incorrectly converted from forward slashes to backslashes on Windows, causing issues when these paths are intended for WSL or other Unix-like environments.

Key Changes:

  • Added logic to detect Unix-style paths before performing path conversion
  • Implemented _isUnixStylePath() method to identify paths that should retain Unix format

}
// Common Unix shell executables that might be found in PATH
const unixShells = ['bash', 'zsh', 'fish', 'sh', 'dash', 'tcsh', 'csh'];
const basename = path.split(/[\\/\\\\]/).pop()?.toLowerCase() || '';
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

The regex pattern /[\\/\\\\]/ contains escaped characters that don't make sense. The pattern should be /[\\/]/ to match either forward slash or backslash. The double-escaped backslash \\\\ in the character class is redundant and incorrect.

Suggested change
const basename = path.split(/[\\/\\\\]/).pop()?.toLowerCase() || '';
const basename = path.split(/[\\/]/).pop()?.toLowerCase() || '';

Copilot uses AI. Check for mistakes.
// Common Unix shell executables that might be found in PATH
const unixShells = ['bash', 'zsh', 'fish', 'sh', 'dash', 'tcsh', 'csh'];
const basename = path.split(/[\\/\\\\]/).pop()?.toLowerCase() || '';
if (unixShells.includes(basename) && !path.includes(':') && !path.includes('\\\\')) {
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

The condition !path.includes('\\\\') checks for double backslashes, but it should check for a single backslash !path.includes('\\') to detect Windows-style paths. The current check would miss paths containing single backslashes.

Suggested change
if (unixShells.includes(basename) && !path.includes(':') && !path.includes('\\\\')) {
if (unixShells.includes(basename) && !path.includes(':') && !path.includes('\\')) {

Copilot uses AI. Check for mistakes.
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.

2 participants