Repository navigation
fix(hub): run .cmd/.bat shims in PTY sessions on Windows - #465
Open
huang-julien wants to merge 1 commit into
Open
huang-julien wants to merge 1 commit into
huang-julien wants to merge 1 commit into
Conversation
|
@huang-julien is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
|
👁️🗨️ Review this pull request with grouped, summarized diffs at: raw result💭 analyzed by {
"headSha": "2cef80a80bb32481947754d63018df3c4ea7b446",
"result": {
"overallSummary": "Fixes PTY sessions on Windows failing to launch `.cmd`/`.bat` shims (pnpm, npx, yarn) because the native terminal API only spawns real `.exe` binaries. A new `resolvePtyCommand()` helper detects such shims and reroutes them through `cmd.exe`, matching the existing child-process spawning logic, with accompanying unit and integration tests.",
"groups": [
{
"key": "pty-cmd-fix",
"label": "PTY .cmd/.bat shim fix",
"summary": "Adds `resolvePtyCommand()` to detect Windows `.cmd`/`.bat` shims (e.g. pnpm, npx, yarn) that ConPTY cannot spawn directly, and routes them through `cmd.exe /d /c` with proper metacharacter escaping, mirroring the existing `startChildProcess()` behavior. `host-terminals.ts` now resolves cwd/env once and passes them through this new resolver before spawning the PTY process.",
"category": "core",
"filePaths": [
"packages/hub/src/node/pty-command.ts",
"packages/hub/src/node/host-terminals.ts"
],
"fileNotes": [
{
"path": "packages/hub/src/node/pty-command.ts",
"text": "Core logic: resolves the real executable via PATH/PATHEXT to decide whether to wrap the command in cmd.exe, and double-escapes metacharacters for batch shims since they reparse their arguments.",
"critical": true
}
]
},
{
"key": "tests",
"label": "Tests for PTY shim handling",
"summary": "Unit tests for `resolvePtyCommand()` covering shim detection, escaping and edge cases, plus a Windows-only integration test verifying an actual `.cmd` shim runs correctly in a PTY session.",
"category": "tests",
"filePaths": [
"packages/hub/src/node/__tests__/pty-command.test.ts",
"packages/hub/src/node/__tests__/host-terminals.test.ts"
]
}
],
"schemaVersion": 1,
"source": "llm",
"generatedAt": "2026-10-27T16:48:04.453Z",
"model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
"locale": "en"
}
} |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #463
descirption
On Windows, PTY sessions could not start commands like pnpm, npx or yarn that are .cmd scripts and the Windows terminal API only launches real .exe programs.
The change detects that case and runs the command through cmd.exe instead, the way
startChildProcess()already does.