close
Skip to content

feat: resolve script shims on Windows#405

Merged
sigoden merged 1 commit into
mainfrom
feat
May 21, 2026
Merged

feat: resolve script shims on Windows#405
sigoden merged 1 commit into
mainfrom
feat

Conversation

@sigoden
Copy link
Copy Markdown
Owner

@sigoden sigoden commented May 21, 2026

When argc --argc-compgen powershell is invoked on Windows, runtime.which() resolves the target command via PATHEXT, which typically returns shim files (prog.cmd, prog.bat, prog.ps1) instead of the actual bash script (prog without extension). The shim is then treated as a bash script by parse_script_args, causing completion to fail.
This PR adds a resolve_script_shim helper (compiled only on Windows) that runs after runtime.which(). If the resolved path has a .cmd, .bat, or .ps1 extension, it looks for a file with the same stem (no extension) in the same directory. If that file exists, it is used as the script path instead.

@sigoden sigoden merged commit 8c43ae2 into main May 21, 2026
4 checks passed
@sigoden sigoden deleted the feat branch May 21, 2026 14:14
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.

1 participant