Skip to content

fix: update @zkochan/cmd-shim to 9.0.3#11595

Merged
zkochan merged 1 commit into
mainfrom
fix/update-cmd-shim
May 12, 2026
Merged

fix: update @zkochan/cmd-shim to 9.0.3#11595
zkochan merged 1 commit into
mainfrom
fix/update-cmd-shim

Conversation

@zkochan

@zkochan zkochan commented May 11, 2026

Copy link
Copy Markdown
Member

Summary

Picks up the MSYS path-translation fix from pnpm/cmd-shim#55.

The sh shim that cmd-shim writes for .cmd / .bat targets ran the script via:

exec cmd /C "<path>" "$@"

When invoked from Git Bash / MSYS / Cygwin on Windows, the path-conversion layer that runs as bash launches a native Win32 process rewrites arguments matching POSIX-path heuristics — a bare /C is treated as a path and rewritten to C:\. cmd.exe then never sees the /C flag, starts interactively, and reads the remainder of the calling script as input until EOF. The fix escapes it as //C (the MSYS escape that passes through to cmd.exe as /C).

Surfaced as the pnpm node failure on PR #11553's Windows CI (example).

Test plan

  • pnpm install updates lockfile cleanly
  • pn run lint:meta passes
  • @pnpm/bins.linker (the only consumer of @zkochan/cmd-shim) compiles and tests pass
  • CI green on Windows

Written by an agent (Claude Code, claude-opus-4-7).

Summary by CodeRabbit

Bug Fixes

  • Fixed batch script execution on Git Bash environments that was preventing proper command output delivery.

Chores

  • Updated command-line shim dependency to version 9.0.3.

Review Change Stack

Picks up the MSYS path-translation fix from pnpm/cmd-shim#55: the sh shim
written for `.cmd` / `.bat` targets now escapes the `/C` switch as `//C`
so Git Bash passes it through to cmd.exe unchanged. Without this, a bare
`/C` was rewritten to `C:\` before reaching cmd.exe — cmd started
interactively and the calling script saw cmd's banner instead of the
wrapped command's output. Affects any cmd-shim-wrapped batch script
invoked from Git Bash / MSYS / Cygwin on Windows.
Copilot AI review requested due to automatic review settings May 11, 2026 23:25
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR bumps @zkochan/cmd-shim to v9.0.3, which fixes Windows Git Bash path translation by escaping the cmd.exe /C switch as //C in generated .cmd/.bat shims. The changeset declares patch updates for @pnpm/bins.linker and pnpm, and workspace configuration references are updated to the new version.

Changes

cmd-shim Dependency Update

Layer / File(s) Summary
Changeset Declaration
.changeset/update-cmd-shim-9-0-3.md
Declares patch-level updates for @pnpm/bins.linker and pnpm; documents the fix in @zkochan/cmd-shim v9.0.3 that escapes the /C switch as //C to prevent Git Bash/MSYS/Cygwin path translation from rewriting it as a C:\-prefixed path.
Workspace Configuration
pnpm-workspace.yaml
Catalog entry for @zkochan/cmd-shim is updated from ^9.0.2 to ^9.0.3; minimumReleaseAgeExclude entry is updated to reference @zkochan/cmd-shim@9.0.3.

Possibly related PRs

  • pnpm/pnpm#11501: Both PRs address the same Windows Git Bash/MSYS2 cmd.exe invocation bug: this PR bumps @zkochan/cmd-shim to escape the /C switch to //C, while the retrieved PR fixes the issue by switching aliases to .exe hardlinks and updating packaging/tests.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A shim escapes with double slash,
Git Bash won't steal its /C stash.
Cmd runs true, no path translation,
Batch scripts sing in elation! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and clearly summarizes the main change: updating @zkochan/cmd-shim to 9.0.3, which is the primary objective of this changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/update-cmd-shim

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the workspace catalog to pick up @zkochan/cmd-shim@9.0.3, which includes an MSYS/Git Bash fix for invoking .cmd/.bat targets (escaping /C as //C so cmd.exe receives the intended flag on Windows MSYS environments).

Changes:

  • Bump @zkochan/cmd-shim from ^9.0.2 to ^9.0.3 in the workspace catalog and exclusion list.
  • Refresh pnpm-lock.yaml to reflect the new resolved version and integrity for @zkochan/cmd-shim@9.0.3.
  • Add a changeset to release patch versions of @pnpm/bins.linker and pnpm documenting the fix.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
pnpm-workspace.yaml Updates the catalog and minimum release age exclude entry to @zkochan/cmd-shim@9.0.3.
pnpm-lock.yaml Updates the lockfile resolution/snapshots to @zkochan/cmd-shim@9.0.3.
.changeset/update-cmd-shim-9-0-3.md Adds release notes and triggers patch releases for the affected packages.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
pnpm-workspace.yaml (1)

347-347: 💤 Low value

Specific version exclusion may be redundant.

Line 346 already excludes all @zkochan/* packages from the minimum release age requirement, which would include @zkochan/cmd-shim@9.0.3. The specific version entry on line 347 appears redundant.

However, if this is intentional for documentation purposes or to explicitly track newly released versions, this is acceptable.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm-workspace.yaml` at line 347, The explicit exclusion entry
'@zkochan/cmd-shim@9.0.3' is redundant because the wildcard exclusion
'@zkochan/*' already covers it; remove the specific line to avoid duplication,
or if you intend to keep it for documentation/audit reasons add a comment
explaining why it's listed separately; search for the entries '@zkochan/*' and
'@zkochan/cmd-shim@9.0.3' to locate and update the configuration accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@pnpm-workspace.yaml`:
- Line 347: The explicit exclusion entry '@zkochan/cmd-shim@9.0.3' is redundant
because the wildcard exclusion '@zkochan/*' already covers it; remove the
specific line to avoid duplication, or if you intend to keep it for
documentation/audit reasons add a comment explaining why it's listed separately;
search for the entries '@zkochan/*' and '@zkochan/cmd-shim@9.0.3' to locate and
update the configuration accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 90206528-02c1-4deb-8f4b-096a7d1fb2b8

📥 Commits

Reviewing files that changed from the base of the PR and between 02e9cf5 and 2be7697.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • .changeset/update-cmd-shim-9-0-3.md
  • pnpm-workspace.yaml
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Agent
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Compile & Lint
🔇 Additional comments (4)
.changeset/update-cmd-shim-9-0-3.md (2)

1-4: LGTM! Changeset format is correct.

The changeset correctly declares patch releases for @pnpm/bins.linker and pnpm, which is appropriate for a dependency update that includes a bug fix.


6-6: Excellent documentation of the fix.

The changeset provides a clear, detailed explanation of:

  • The root cause (MSYS path translation rewriting /C to C:\)
  • The solution (escaping as //C)
  • The impact (affects cmd-shim-wrapped batch scripts in Git Bash/MSYS/Cygwin)
  • Reference to the upstream fix

This level of detail will be valuable for users understanding what changed and why.

pnpm-workspace.yaml (2)

149-149: Dependency update is valid. The package @zkochan/cmd-shim@9.0.3 is published to npm with no known security vulnerabilities.


149-149: No action needed—version references are consistent.

All references to @zkochan/cmd-shim in pnpm-workspace.yaml are consistent at version 9.0.3 (line 149 and line 347).

@zkochan zkochan merged commit b4f8f47 into main May 12, 2026
17 checks passed
@zkochan zkochan deleted the fix/update-cmd-shim branch May 12, 2026 06:24
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