Skip to content

fix(process): prioritize PATHEXT extensions over extensionless files on Windows#4

Open
SpencerJung wants to merge 1 commit into
code-yeongyu:mainfrom
SpencerJung:fix/windows-wrapper-script-priority
Open

fix(process): prioritize PATHEXT extensions over extensionless files on Windows#4
SpencerJung wants to merge 1 commit into
code-yeongyu:mainfrom
SpencerJung:fix/windows-wrapper-script-priority

Conversation

@SpencerJung

@SpencerJung SpencerJung commented May 22, 2026

Copy link
Copy Markdown

Description

Fixes code-yeongyu/oh-my-openagent#4262

On Windows, getWindowsPathExtensions returns an empty string at the beginning of the extensions array. This causes resolveWindowsCommand to prioritize extensionless files over .bat/.cmd wrapper scripts when resolving commands from PATH.

Changes

  • Moved empty string from the start to the end of the extensions array in getWindowsPathExtensions.
  • This ensures Windows PATHEXT extensions (.COM, .EXE, .BAT, .CMD) are checked first, matching cmd.exe behavior.

Verification

  • Manually verified that resolveWindowsCommand now prefers .bat over extensionless files.

Checklist

  • PR targets main branch
  • npm run build passes
  • npm test passes

Summary by cubic

Fixes command resolution on Windows to prioritize PATHEXT extensions over extensionless files, so .bat/.cmd wrapper scripts are chosen first, matching cmd.exe behavior. Implemented by moving the empty extension to the end of getWindowsPathExtensions.

Written for commit a8e1480. Summary will update on new commits. Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

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.

[Bug]: LSP server fails to start on Windows when wrapper script (.bat/.cmd) is needed

1 participant